feat: [approval] 재직증명서 양식 마이그레이션 추가
- approval_forms 테이블에 employment_cert 폼 삽입
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
$tenants = DB::table('tenants')->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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user