chore: archived_records record_type을 varchar로 변경

- enum('tenant','user') → varchar(50)
- 확장성 확보 (department, menu, role 등 추가 가능)
This commit is contained in:
2025-12-02 15:49:31 +09:00
parent aabd791336
commit 2f2999bb39

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*
* record_type을 enum에서 varchar로 변경하여 확장성 확보
* 기존 값: 'tenant', 'user'
* 확장 예정: 'department', 'menu', 'role', 'board', 'project', 'issue', 'task' 등
*/
public function up(): void
{
// MySQL에서 enum을 varchar로 변경
// 기존 데이터는 그대로 유지됨
DB::statement("ALTER TABLE archived_records MODIFY COLUMN record_type VARCHAR(50) NOT NULL");
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// varchar를 다시 enum으로 변경 (기존 값만)
DB::statement("ALTER TABLE archived_records MODIFY COLUMN record_type ENUM('tenant', 'user') NOT NULL");
}
};