<?php

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

/**
 * Migration auto-generated by Sequel Pro Laravel Export
 * @see https://github.com/cviebrock/sequel-pro-laravel-export
 */
class CreateUserAccessTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_access', function (Blueprint $table) {
            $table->increments('id');
            $table->string('appid')->comment('app_id')->default(0);
            $table->integer('role_id')->comment('角色的ID');
            $table->integer('menu_id')->comment('菜单ID');
            $table->nullableTimestamps();
            $table->softDeletes();

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

            

        });
    }

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