diff --git a/views/001_alter_deferred_tables.sql b/views/001_alter_deferred_tables.sql index 293b474e..490927c7 100644 --- a/views/001_alter_deferred_tables.sql +++ b/views/001_alter_deferred_tables.sql @@ -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);