From 93e94901b7473060552c8e3c23dc83d04f53f6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 28 Feb 2026 21:23:19 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[interview]=20=EC=B9=B4=ED=85=8C?= =?UTF-8?q?=EA=B3=A0=EB=A6=AC=20=EA=B3=84=EC=B8=B5=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?parent=5Fid=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - interview_categories 테이블에 parent_id 컬럼 추가 - self-referencing FK, nullOnDelete --- ...arent_id_to_interview_categories_table.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 database/migrations/2026_02_28_100005_add_parent_id_to_interview_categories_table.php diff --git a/database/migrations/2026_02_28_100005_add_parent_id_to_interview_categories_table.php b/database/migrations/2026_02_28_100005_add_parent_id_to_interview_categories_table.php new file mode 100644 index 0000000..8b926b8 --- /dev/null +++ b/database/migrations/2026_02_28_100005_add_parent_id_to_interview_categories_table.php @@ -0,0 +1,26 @@ +unsignedBigInteger('parent_id')->nullable()->after('interview_project_id')->comment('부모 카테고리 ID (대분류→중분류)'); + $table->index('parent_id', 'idx_interview_categories_parent'); + $table->foreign('parent_id')->references('id')->on('interview_categories')->nullOnDelete(); + }); + } + + public function down(): void + { + Schema::table('interview_categories', function (Blueprint $table) { + $table->dropForeign(['parent_id']); + $table->dropIndex('idx_interview_categories_parent'); + $table->dropColumn('parent_id'); + }); + } +};