123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateTablePostComment extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('post_comment', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->integer('post_id')
- ->index('post_id')
- ->comment('帖子id');
- $table->integer('parent_id')
- ->default(0)
- ->comment('评论id');
- $table->integer('uid')
- ->index('uid')
- ->unsigned()
- ->comment('uid');
- $table->string('username', 32)
- ->default('')
- ->comment('昵称');
- $table->string('avatar', 255)
- ->default('')
- ->comment('头像');
- $table->string('content', 200)
- ->default('')
- ->comment('评论内容');
- $table->integer('praise_count')
- ->default(0)
- ->comment('点赞数');
-
- $table->tinyInteger('is_delete')
- ->default(0)
- ->comment('是否删除:0否,1是');
-
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('post_comment');
- }
- }
|