<?php

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

class CreateMenuInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menu_info', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('pid');
            $table->integer('template_id')->comment('同一模板同一菜单')->default(0);
            $table->char('path', 60)->comment('URL');
            $table->char('name', 50)->comment('节点的名字');
            $table->tinyInteger('display')->default(1)->comment('1为显示为菜单，0则不显示');
            $table->integer('sort')->default(1)->comment('排序');
            $table->tinyInteger('level')->default(1)->comment('第几级菜单');
            $table->char('ico', 20)->comment('菜单图标');
            $table->string('mark', 255)->comment('备注');
            $table->nullableTimestamps();
            $table->softDeletes();

            $table->index('deleted_at', 'idx_deleted_at');
        });
    }

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