fix(topology): delete topology_mutations in delete-cascade
delete_topology_cascade manually deletes status_events, edges, deckies and lans but overlooked topology_mutations, so deleting any topology that ever had a mutation enqueued (i.e. edits while active|degraded) failed with an FK IntegrityError. Add the missing DELETE and extend the cascade test to seed a mutation row.
This commit is contained in:
@@ -1111,6 +1111,10 @@ class SQLModelRepository(BaseRepository):
|
||||
text("DELETE FROM lans WHERE topology_id = :t"),
|
||||
params,
|
||||
)
|
||||
await session.execute(
|
||||
text("DELETE FROM topology_mutations WHERE topology_id = :t"),
|
||||
params,
|
||||
)
|
||||
result = await session.execute(
|
||||
select(Topology).where(Topology.id == topology_id)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user