-- Phase 3 프로덕션 배포 마이그레이션
-- 상태: VERIFIED

BEGIN TRANSACTION;

-- 1. 모델 저장소 활성화
UPDATE model_operations.model
SET status = 'ACTIVATED', activated_at = CURRENT_TIMESTAMP
WHERE status = 'READY_FOR_ACTIVATION'
  AND approval_status = 'APPROVED';

-- 2. 감시 로그 정리
DELETE FROM compliance.operation_audit_trail
WHERE occurred_at < CURRENT_DATE - INTERVAL '90 days'
  AND event_type IN ('STARTUP', 'HEARTBEAT');

COMMIT;
