From 6db428ccc50c3599561d51a9e68f9507e3e6e2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 31 Jan 2026 19:35:00 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EC=98=81=EC=97=85=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=EC=97=90=20tenant=5Fprospect=5Fid?= =?UTF-8?q?=20=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sales_tenant_managements에 tenant_prospect_id 추가 - sales_scenario_checklists에 tenant_prospect_id 추가 - 가망고객 단계에서도 영업/매니저 체크리스트 사용 가능 Co-Authored-By: Claude Opus 4.5 --- ...add_tenant_prospect_id_to_sales_tables.php | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 database/migrations/2026_01_31_200000_add_tenant_prospect_id_to_sales_tables.php diff --git a/database/migrations/2026_01_31_200000_add_tenant_prospect_id_to_sales_tables.php b/database/migrations/2026_01_31_200000_add_tenant_prospect_id_to_sales_tables.php new file mode 100644 index 0000000..4c7a5ac --- /dev/null +++ b/database/migrations/2026_01_31_200000_add_tenant_prospect_id_to_sales_tables.php @@ -0,0 +1,51 @@ +unsignedBigInteger('tenant_prospect_id')->nullable()->after('tenant_id'); + $table->foreign('tenant_prospect_id')->references('id')->on('tenant_prospects')->onDelete('cascade'); + + // tenant_id를 nullable로 변경 (가망고객 단계에서는 tenant 없음) + $table->unsignedBigInteger('tenant_id')->nullable()->change(); + }); + + // sales_scenario_checklists 테이블에 tenant_prospect_id 추가 + Schema::table('sales_scenario_checklists', function (Blueprint $table) { + $table->unsignedBigInteger('tenant_prospect_id')->nullable()->after('tenant_id'); + $table->foreign('tenant_prospect_id')->references('id')->on('tenant_prospects')->onDelete('cascade'); + + // tenant_id를 nullable로 변경 + $table->unsignedBigInteger('tenant_id')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('sales_scenario_checklists', function (Blueprint $table) { + $table->dropForeign(['tenant_prospect_id']); + $table->dropColumn('tenant_prospect_id'); + }); + + Schema::table('sales_tenant_managements', function (Blueprint $table) { + $table->dropForeign(['tenant_prospect_id']); + $table->dropColumn('tenant_prospect_id'); + }); + } +};