fix: global_menus 마이그레이션에 테이블 존재 체크 추가
- 개발 서버에서 테이블 이미 존재 시 에러 발생 방지 - Schema::hasTable() 체크로 중복 생성 스킵
This commit is contained in:
@@ -20,7 +20,11 @@
|
|||||||
{
|
{
|
||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
// 1. global_menus 테이블 생성
|
// 1. global_menus 테이블 생성 (이미 존재하면 스킵)
|
||||||
|
if (Schema::hasTable('global_menus')) {
|
||||||
|
return; // 이미 테이블이 존재하면 마이그레이션 스킵
|
||||||
|
}
|
||||||
|
|
||||||
Schema::create('global_menus', function (Blueprint $table) {
|
Schema::create('global_menus', function (Blueprint $table) {
|
||||||
$table->id()->comment('PK: 글로벌 메뉴 ID');
|
$table->id()->comment('PK: 글로벌 메뉴 ID');
|
||||||
$table->unsignedBigInteger('parent_id')->nullable()->comment('상위 메뉴 ID');
|
$table->unsignedBigInteger('parent_id')->nullable()->comment('상위 메뉴 ID');
|
||||||
|
|||||||
Reference in New Issue
Block a user