Files
sam-api/database/migrations/2025_07_26_051643_create_menus_table.php
kent b436b635c2 fix : 테이블 추가 및 수정 신규로 작성 (generator 설치)
composer require --dev kitloong/laravel-migrations-generator
php artisan migrate:generate
2025-07-26 05:22:58 +09:00

38 lines
1.4 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
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')->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')->nullable()->comment('외부링크 URL');
$table->string('icon', 50)->nullable()->comment('아이콘명');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('menus');
}
};