Files
sam-api/database/migrations/2025_07_23_140449_create_menus_table.php

31 lines
1.3 KiB
PHP
Raw Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('menus', function (Blueprint $table) {
$table->bigIncrements('id')->comment('PK: 메뉴 ID');
$table->unsignedBigInteger('tenant_id')->nullable()->index()->comment('FK: 테넌트 ID(null=공용메뉴)');
$table->unsignedBigInteger('parent_id')->nullable()->index()->comment('상위 메뉴 ID');
$table->string('name', 100)->comment('메뉴명');
$table->string('url', 255)->nullable()->comment('메뉴 URL');
$table->boolean('is_active')->default(true)->comment('활성여부(1=활성,0=비활성)');
$table->integer('sort_order')->default(0)->comment('정렬순서');
$table->boolean('hidden')->default(false)->comment('숨김여부');
$table->boolean('is_external')->default(false)->comment('외부링크여부');
$table->string('external_url', 255)->nullable()->comment('외부링크 URL');
$table->string('icon', 50)->nullable()->comment('아이콘명');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('menus');
}
};