fs-lawrisk/lawrisk
Codex Agent e462f609ba fix: resolve foreign key constraint violation during checkpoint restore
Issue:
- Restore operation failed with foreign key constraint violation
- Error: "update or delete on table business_scopes violates foreign key constraint"
- Problem: DELETE operations didn't handle foreign key dependencies correctly

Solution:
- Changed DELETE FROM to TRUNCATE TABLE ... CASCADE in _restore_table()
- TRUNCATE with CASCADE automatically removes dependent records
- Now restore operation properly handles all foreign key relationships
- Data can be restored without constraint violations

This ensures checkpoint restore works correctly across all related tables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 13:39:01 +08:00
..
api feat: add database checkpoint management system 2025-10-30 10:33:35 +08:00
middleware refactor: 重新规划项目结构为标准Python包 2025-10-29 15:31:01 +08:00
services fix: resolve foreign key constraint violation during checkpoint restore 2025-10-30 13:39:01 +08:00
utils refactor: 重新规划项目结构为标准Python包 2025-10-29 15:31:01 +08:00
__init__.py refactor: 重新规划项目结构为标准Python包 2025-10-29 15:31:01 +08:00