2016_10_31_032321_create_vote_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateVoteTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. //
  15. Schema::create('votes', function(Blueprint $table){
  16. $table->increments('id')->comment('投票记录id');
  17. $table->integer('player_id')->unsigned()->comment('得票人');
  18. $table->string('openid')->comment('投票微信用户的个人openid, 用于防止刷票');
  19. $table->integer('vote')->unsigned()->default('1')->comment('投票数, 为1');
  20. $table->string('we_nickname', 120)->comment('微信用户昵称');
  21. $table->string('we_image')->comment('微信用户的头像地址');
  22. $table->timestamp('created_at')->nullable()->comment('投票时间');
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. //
  33. Schema::drop('votes');
  34. }
  35. }