<?php

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

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('后台菜单表');
            $table->integer('parent_id')->default(0)->comment('父级id');
            $table->string('icon')->comment('图标');
            $table->string('title')->comment('栏目名称');
            $table->string('slug')->nullable()->comment('标识');
            $table->string('category')->nullable()->comment('分类');
            $table->string('path')->comment('路由');
            $table->integer('sort')->default(10)->comment('排序');
            $table->integer('tier')->default(1)->comment('层级');
            $table->char('show', 1)->default(1)->comment('是否显示');
            $table->char('can_del', 1)->default(1)->comment('是否可以删除');
            $table->string('degree')->nullable()->comment('菜单关联');
            $table->text('thumb')->nullable()->comment('缩略图');
            $table->timestamps();
            $table->softDeletes();
        });
    }

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