mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
39 lines
992 B
PHP
39 lines
992 B
PHP
|
|
<?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()
|
||
|
|
{
|
||
|
|
Schema::create('menus', function (Blueprint $table) {
|
||
|
|
$table->bigIncrements('id');
|
||
|
|
$table->string('code', 32)->nullable(false)->comment('菜单编码');
|
||
|
|
$table->string('name', 32)->nullable(false)->comment('菜单名称');
|
||
|
|
$table->unsignedBigInteger('parent_id')->default(0);
|
||
|
|
$table->unsignedInteger('seq')->default(0)->comment('排序序号');
|
||
|
|
$table->softDeletes();
|
||
|
|
$table->timestamps();
|
||
|
|
// 索引
|
||
|
|
$table->unique('code');
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Reverse the migrations.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function down()
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('menus');
|
||
|
|
}
|
||
|
|
}
|