From ad93743bdca3dcf4c180dc37772c0bfa0280b216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 7 Mar 2026 00:28:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[approval]=20=EC=97=B0=EC=B0=A8?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=B4=89=EC=A7=84=20=ED=86=B5=EC=A7=80?= =?UTF-8?q?=EC=84=9C=201=EC=B0=A8/2=EC=B0=A8=20=EC=96=91=EC=8B=9D=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - leave_promotion_1st: 연차사용촉진 통지서 (1차) - hr 카테고리 - leave_promotion_2nd: 연차사용촉진 통지서 (2차) - hr 카테고리 --- ...03_07_100000_add_leave_promotion_forms.php | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 database/migrations/2026_03_07_100000_add_leave_promotion_forms.php diff --git a/database/migrations/2026_03_07_100000_add_leave_promotion_forms.php b/database/migrations/2026_03_07_100000_add_leave_promotion_forms.php new file mode 100644 index 0000000..71653da --- /dev/null +++ b/database/migrations/2026_03_07_100000_add_leave_promotion_forms.php @@ -0,0 +1,60 @@ +whereNull('deleted_at')->pluck('id'); + + foreach ($tenants as $tenantId) { + // 1차 통지서 + $exists1st = DB::table('approval_forms') + ->where('tenant_id', $tenantId) + ->where('code', 'leave_promotion_1st') + ->exists(); + + if (! $exists1st) { + DB::table('approval_forms')->insert([ + 'tenant_id' => $tenantId, + 'name' => '연차사용촉진 통지서 (1차)', + 'code' => 'leave_promotion_1st', + 'category' => 'hr', + 'template' => '[]', + 'body_template' => '', + 'is_active' => true, + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + + // 2차 통지서 + $exists2nd = DB::table('approval_forms') + ->where('tenant_id', $tenantId) + ->where('code', 'leave_promotion_2nd') + ->exists(); + + if (! $exists2nd) { + DB::table('approval_forms')->insert([ + 'tenant_id' => $tenantId, + 'name' => '연차사용촉진 통지서 (2차)', + 'code' => 'leave_promotion_2nd', + 'category' => 'hr', + 'template' => '[]', + 'body_template' => '', + 'is_active' => true, + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } + } + + public function down(): void + { + DB::table('approval_forms')->where('code', 'leave_promotion_1st')->delete(); + DB::table('approval_forms')->where('code', 'leave_promotion_2nd')->delete(); + } +};