2022-08-01 04:18:07 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
class CreateMenusTable extends Migration
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
2022-08-09 16:56:52 +08:00
|
|
|
Schema::defaultStringLength(191);
|
2022-08-01 04:18:07 +08:00
|
|
|
Schema::create('menus', function (Blueprint $table) {
|
|
|
|
|
$table->bigIncrements('id');
|
2022-08-18 11:22:27 +08:00
|
|
|
$table->string('code', 32)->unique()->comment('菜单编码');
|
|
|
|
|
$table->string('name', 32)->comment('菜单名称');
|
2022-08-01 04:18:07 +08:00
|
|
|
$table->unsignedBigInteger('parent_id')->default(0);
|
|
|
|
|
$table->unsignedInteger('seq')->default(0)->comment('排序序号');
|
|
|
|
|
$table->softDeletes();
|
|
|
|
|
$table->timestamps();
|
|
|
|
|
// 索引
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('menus');
|
|
|
|
|
}
|
|
|
|
|
}
|