From fd3dbb75afcbc8ccb615a2bfee037bf7386e207f 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:50:37 +0900 Subject: [PATCH] =?UTF-8?q?feat:sales=5Fconsultations=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=EC=97=90=20tenant=5Fprospect=5Fid=20=EC=BB=AC?= =?UTF-8?q?=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 - 가망고객(prospect) 상담 기록 지원을 위해 tenant_prospect_id 컬럼 추가 - tenant_id를 nullable로 변경 (가망고객일 경우 null) - tenant_prospect_id 인덱스 추가 Co-Authored-By: Claude Opus 4.5 --- ...ant_prospect_id_to_sales_consultations.php | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 database/migrations/2026_01_31_210000_add_tenant_prospect_id_to_sales_consultations.php diff --git a/database/migrations/2026_01_31_210000_add_tenant_prospect_id_to_sales_consultations.php b/database/migrations/2026_01_31_210000_add_tenant_prospect_id_to_sales_consultations.php new file mode 100644 index 0000000..7cae1db --- /dev/null +++ b/database/migrations/2026_01_31_210000_add_tenant_prospect_id_to_sales_consultations.php @@ -0,0 +1,43 @@ +unsignedBigInteger('tenant_prospect_id') + ->nullable() + ->after('tenant_id') + ->comment('가망고객 ID (테넌트 전환 전)'); + + // tenant_id를 nullable로 변경 (가망고객일 경우 null) + $table->unsignedBigInteger('tenant_id')->nullable()->change(); + + // 인덱스 추가 + $table->index(['tenant_prospect_id', 'scenario_type'], 'consultations_prospect_scenario_idx'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('sales_consultations', function (Blueprint $table) { + $table->dropIndex('consultations_prospect_scenario_idx'); + $table->dropColumn('tenant_prospect_id'); + + // tenant_id를 다시 not nullable로 변경 + $table->unsignedBigInteger('tenant_id')->nullable(false)->change(); + }); + } +};