<?php

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

class CreateUserChannelsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_channels', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('渠道名称');
            $table->string('cover')->nullable()->comment('封面');
            $table->string('code')->unique()->comment('渠道码');
            $table->string('mini_code')->nullable()->comment('小程序码');
            $table->string('mini_path')->nullable()->comment('小程序路径');
            $table->string('official_code')->nullable()->comment('h5码');
            $table->boolean('status')->default(1);
            $table->timestamps();
        });
    }

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