From 198ba8688cfc125a921c37e0b9632a7abb746227 Mon Sep 17 00:00:00 2001 From: hskwon Date: Tue, 2 Dec 2025 22:11:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20PM=20=EC=9D=B4=EC=8A=88=EC=97=90=20?= =?UTF-8?q?=ED=8C=80/=EB=8B=B4=EB=8B=B9=EC=9E=90/=EA=B3=A0=EA=B0=9D?= =?UTF-8?q?=EC=82=AC=20=ED=95=84=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - department_id, team: 부서 (하이브리드 FK + 문자열) - assignee_id, assignee_name: 담당자 (하이브리드) - client: 고객사명 (문자열) --- ...client_fields_to_admin_pm_issues_table.php | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 database/migrations/2025_12_02_183031_add_team_assignee_client_fields_to_admin_pm_issues_table.php diff --git a/database/migrations/2025_12_02_183031_add_team_assignee_client_fields_to_admin_pm_issues_table.php b/database/migrations/2025_12_02_183031_add_team_assignee_client_fields_to_admin_pm_issues_table.php new file mode 100644 index 0000000..91a289e --- /dev/null +++ b/database/migrations/2025_12_02_183031_add_team_assignee_client_fields_to_admin_pm_issues_table.php @@ -0,0 +1,80 @@ +foreignId('department_id') + ->nullable() + ->after('is_urgent') + ->constrained('departments') + ->nullOnDelete() + ->comment('부서 FK (연동 시)'); + $table->string('team', 100) + ->nullable() + ->after('department_id') + ->comment('팀/부서명 (직접 입력)'); + + // 담당자 (하이브리드: FK 또는 문자열) + $table->foreignId('assignee_id') + ->nullable() + ->after('team') + ->constrained('users') + ->nullOnDelete() + ->comment('담당자 FK (연동 시)'); + $table->string('assignee_name', 100) + ->nullable() + ->after('assignee_id') + ->comment('담당자명 (직접 입력)'); + + // 고객사 + $table->string('client', 100) + ->nullable() + ->after('assignee_name') + ->comment('고객사명'); + + // 인덱스 + $table->index('department_id', 'idx_admin_pm_issues_department'); + $table->index('assignee_id', 'idx_admin_pm_issues_assignee'); + $table->index('client', 'idx_admin_pm_issues_client'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('admin_pm_issues', function (Blueprint $table) { + // 인덱스 삭제 + $table->dropIndex('idx_admin_pm_issues_department'); + $table->dropIndex('idx_admin_pm_issues_assignee'); + $table->dropIndex('idx_admin_pm_issues_client'); + + // FK 삭제 + $table->dropForeign(['department_id']); + $table->dropForeign(['assignee_id']); + + // 컬럼 삭제 + $table->dropColumn([ + 'department_id', + 'team', + 'assignee_id', + 'assignee_name', + 'client', + ]); + }); + } +};