Route deletion failed with two integrity errors: 1. route_encounters had no cascade, so SQLAlchemy tried to NULL the non-nullable route_id instead of deleting the rows 2. boss_battles.after_route_id referenced the route being deleted Added cascade="all, delete-orphan" to Route.route_encounters and nulled out boss battle after_route_id references before deletion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
676 B
676 B
title, status, type, priority, created_at, updated_at
| title | status | type | priority | created_at | updated_at |
|---|---|---|---|---|---|
| Fix route deletion failing due to missing cascade on route_encounters | completed | bug | normal | 2026-02-14T14:19:56Z | 2026-02-14T14:23:10Z |
Deleting a route returns 500 due to two FK constraint issues:
route_encounters.route_id— missing cascade on the relationship (SQLAlchemy tried to NULL a NOT NULL column)boss_battles.after_route_id— references the route being deleted
Fix
- Added
cascade="all, delete-orphan"toRoute.route_encountersrelationship - Added
update(BossBattle).where(...).values(after_route_id=None)before deleting the route in the delete endpoint