Skip to content

Commit

Permalink
chore: handle config item deletion which are linked to components
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Nov 3, 2024
1 parent da33989 commit a260ae1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions views/001_alter_deferred_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ BEGIN
DELETE FROM check_config_relationships
WHERE config_id IN (SELECT id FROM config_items_to_delete);

-- Components are independent so we just unset config_id
UPDATE components SET config_id = NULL
WHERE config_id IN (SELECT id FROM config_items_to_delete);

-- Finally, delete the config_items themselves
DELETE FROM config_items
WHERE id IN (SELECT id FROM config_items_to_delete);
Expand Down

0 comments on commit a260ae1

Please sign in to comment.