fix(migration): PRAGMA foreign_keys 처리 추가

- PRAGMA foreign_keys = OFF (마이그레이션 시작)
- PRAGMA foreign_keys = ON (마이그레이션 완료 후)
- 프로덕션 배포 완료 (25 queries, 3.55ms)
This commit is contained in:
kappa
2026-01-19 16:09:28 +09:00
parent bda70c9675
commit e3314e301a

View File

@@ -3,6 +3,11 @@
-- Date: 2026-01-19
-- Author: Claude Code
-- =============================================================================
-- IMPORTANT: Disable FOREIGN KEY constraints during migration
-- =============================================================================
PRAGMA foreign_keys = OFF;
-- =============================================================================
-- STEP 1: user_deposits - Add CHECK constraint for balance >= 0
-- =============================================================================
@@ -143,6 +148,11 @@ SELECT 'audit_logs', COUNT(*) FROM audit_logs;
-- INSERT INTO user_deposits (user_id, balance) VALUES (999999, -1000);
-- INSERT INTO deposit_transactions (user_id, type, amount, depositor_name) VALUES (999999, 'deposit', 1000, 'ThisIsAVeryLongNameThatExceedsFiftyCharactersAndShouldBeTruncatedOrRejected');
-- =============================================================================
-- Re-enable FOREIGN KEY constraints
-- =============================================================================
PRAGMA foreign_keys = ON;
-- =============================================================================
-- MIGRATION COMPLETE
-- =============================================================================