Skip to content

Commit

Permalink
permission: cascade delete
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Dec 19, 2024
1 parent defd0ea commit 09aca0a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions schema/permissions.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 09aca0a

Please sign in to comment.