mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
CASCADE was defined for keys & values, but in practice those are never directly deleted except in the very case in which it has been established that they are 'orphaned', i.e. no longer being referrred to. That's exactly the case in which CASCADE is superfluous. As a result, in the test for issue deletion (which contains a prune of tagvalue), the following 3 queries are no longer done: ``` SELECT "tags_tagvalue"."id", "tags_tagvalue"."project_id", "tags_tagvalue"."key_id", "tags_tagvalue"."value" FROM "tags_tagvalue" WHERE "tags_tagvalue"."id" IN (1) DELETE FROM "tags_eventtag" WHERE "tags_eventtag"."value_id" IN (1) DELETE FROM "tags_issuetag" WHERE "tags_issuetag"."value_id" IN (1) ```