feat: [archived-records] 아카이브 복원 기능 및 테넌트 필터링 구현
Phase 1 - 아카이브 복원 기능: - ArchiveService: 모델별 아카이브 로직 통합 (326줄) - RestoreService: 복원 로직 및 충돌 검사 (319줄) - ArchivedRecordController: restore, checkRestore 메서드 추가 - record_type enum→varchar 마이그레이션 - 복원 버튼 및 충돌 체크 UI (restore-check.blade.php) Phase 2 - 테넌트 필터링: - ArchivedRecord 모델: tenant_id fillable, tenant 관계 추가 - ArchiveService: tenant_id 저장 로직 (determineTenantId) - ArchivedRecordService: 테넌트별 필터링 쿼리 - 목록 UI: ID 컬럼, 대상 테넌트 컬럼 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user