| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateCommentsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('comments', function (Blueprint $table) {
- $table->increments('id')->unsigned();
- $table->integer('user_id')->unsigned()->index(); //评论人
- $table->text('content');
- $table->morphs('source');
- $table->integer('to_user_id')->unsigned()->nullable();
- $table->tinyInteger('status')->default(1);
- $table->tinyInteger('device')->default(1)->comment("设备类型:1web版本,2小程序"); //提问设备类型1pc,2安卓,3IOS,4weixin
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('comments');
- }
- }
|