diff --git a/database/migrations/2026_03_05_184507_add_employment_cert_form.php b/database/migrations/2026_03_05_184507_add_employment_cert_form.php new file mode 100644 index 0000000..67806b7 --- /dev/null +++ b/database/migrations/2026_03_05_184507_add_employment_cert_form.php @@ -0,0 +1,38 @@ +whereNull('deleted_at')->pluck('id'); + + foreach ($tenants as $tenantId) { + $exists = DB::table('approval_forms') + ->where('tenant_id', $tenantId) + ->where('code', 'employment_cert') + ->exists(); + + if (! $exists) { + DB::table('approval_forms')->insert([ + 'tenant_id' => $tenantId, + 'name' => '재직증명서', + 'code' => 'employment_cert', + 'category' => 'certificate', + 'template' => '[]', + 'body_template' => '', + 'is_active' => true, + 'created_at' => now(), + 'updated_at' => now(), + ]); + } + } + } + + public function down(): void + { + DB::table('approval_forms')->where('code', 'employment_cert')->delete(); + } +};