<?php

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

class CreateBilibiliUpVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bilibili_up_videos', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger("mid")->comment("up的唯一识别 id");
            $table->string("up_name")->comment("up 名");
            $table->bigInteger("video_id")->comment("视频 id");
            $table->unsignedTinyInteger("is_available")->comment("是否有效，0：有效，1：失效");
            $table->unsignedTinyInteger("is_downloaded")->comment("是否已下载, 0: 未下载, 1：已下载");
            $table->timestamps();
            $table->index(["mid", "video_id"], "idx_mid_aid");
        });
    }

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