2021_12_30_082824_create_user_show_table.php 1.28 KB
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserShowTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_show', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedBigInteger('user_id')->comment('用户id');
            $table->text('content')->comment('内容描述');
            $table->unsignedTinyInteger('type')->comment('1=图文,2=视频');
            $table->unsignedBigInteger('pick_id')->index()->comment('引用的秀id');
            $table->integer('fav_num')->comment('收藏数');
            $table->integer('view_num')->comment('观看数');
            $table->integer('praise_num')->comment('点赞数');
            $table->integer('comment_num')->comment('评论数');
            $table->unsignedBigInteger('child_id')->comment('图文/视频表id');
            $table->unsignedTinyInteger('state')->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_show');
    }
}