| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateVoteTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- //
- Schema::create('votes', function(Blueprint $table){
- $table->increments('id')->comment('投票记录id');
- $table->integer('player_id')->unsigned()->comment('得票人');
- $table->string('openid')->comment('投票微信用户的个人openid, 用于防止刷票');
- $table->integer('vote')->unsigned()->default('1')->comment('投票数, 为1');
- $table->string('we_nickname', 120)->comment('微信用户昵称');
- $table->string('we_image')->comment('微信用户的头像地址');
- $table->timestamp('created_at')->nullable()->comment('投票时间');
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- //
- Schema::drop('votes');
- }
- }
|