Bulk DELETE FROM routes bypasses ORM-level cascades, causing FK violations on route_encounters and boss_battles
Manually delete route_encounters and nullify boss_battle.after_route_id before deleting stale routes
Skip pruning routes that are referenced by user encounters
Test plan
Run python -m app.seeds --prune against a database with stale routes and verify it completes without FK errors
## Summary
- Bulk `DELETE FROM routes` bypasses ORM-level cascades, causing FK violations on `route_encounters` and `boss_battles`
- Manually delete `route_encounters` and nullify `boss_battle.after_route_id` before deleting stale routes
- Skip pruning routes that are referenced by user encounters
## Test plan
- [ ] Run `python -m app.seeds --prune` against a database with stale routes and verify it completes without FK errors
Bulk delete bypasses ORM-level cascades, so manually delete
route_encounters, nullify boss_battle.after_route_id, and skip
routes referenced by user encounters before deleting stale routes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
DELETE FROM routesbypasses ORM-level cascades, causing FK violations onroute_encountersandboss_battlesroute_encountersand nullifyboss_battle.after_route_idbefore deleting stale routesTest plan
python -m app.seeds --pruneagainst a database with stale routes and verify it completes without FK errors