diff --git a/schema/permissions.hcl b/schema/permissions.hcl index 535fb50c..65b52d86 100644 --- a/schema/permissions.hcl +++ b/schema/permissions.hcl @@ -102,57 +102,55 @@ table "permissions" { columns = [column.playbook_id] ref_columns = [table.playbooks.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } - foreign_key "permissions_canary_id_fkey" { columns = [column.canary_id] ref_columns = [table.canaries.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_component_id_fkey" { columns = [column.component_id] ref_columns = [table.components.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_connection_id_fkey" { columns = [column.connection_id] ref_columns = [table.connections.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_config_id_fkey" { columns = [column.config_id] ref_columns = [table.config_items.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_created_by_fkey" { columns = [column.created_by] ref_columns = [table.people.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_notification_fkey" { columns = [column.notification_id] ref_columns = [table.notifications.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } foreign_key "permissions_person_fkey" { columns = [column.person_id] ref_columns = [table.people.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } - foreign_key "permissions_team_fkey" { columns = [column.team_id] ref_columns = [table.teams.column.id] on_update = NO_ACTION - on_delete = NO_ACTION + on_delete = CASCADE } index "permissions_config_id_idx" {