2022_01_24_163547_create_immerse_table.php 1.62 KB
<?php

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

class CreateImmerseTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('immerse', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedBigInteger('user_id')->index()->comment('用户id');
            $table->string('title')->default('')->comment('标题');
            $table->text('content')->comment('内容');
            $table->unsignedTinyInteger('type')->comment('音频图文=1,视频=2');
            $table->unsignedBigInteger('duration')->comment('时长');
            $table->unsignedBigInteger('size')->comment('大小');
            $table->integer('praise')->comment('点赞量');
            $table->integer('view')->comment('播放量');
            $table->integer('collect')->comment('收藏量');
            $table->integer('share')->comment('分享量');
            $table->integer('comment')->comment('评论数');
            $table->unsignedTinyInteger('is_self')->index()->default('1')->comment('自制=1,搬运=2');
            $table->unsignedTinyInteger('is_publish')->index()->default('1')->comment('草稿=0,发布=1');
            $table->unsignedTinyInteger('is_check')->index()->default('0')->comment('审核通过=1,未通过=0');
            $table->timestamps();
        });
    }

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