From 7288a79564d9d3e92d0fec4db65f5b7292531c6d Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Mon, 23 Sep 2024 10:21:18 +0300 Subject: [PATCH] chore: add connection_id to the permissions table --- schema/permissions.hcl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/schema/permissions.hcl b/schema/permissions.hcl index e505159a..e418a223 100644 --- a/schema/permissions.hcl +++ b/schema/permissions.hcl @@ -39,6 +39,11 @@ table "permissions" { type = uuid } + column "connection_id" { + null = true + type = uuid + } + column "created_by" { null = false type = uuid @@ -95,6 +100,12 @@ table "permissions" { on_update = NO_ACTION on_delete = NO_ACTION } + foreign_key "permissions_connection_id_fkey" { + columns = [column.connection_id] + ref_columns = [table.connections.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } foreign_key "permissions_config_id_fkey" { columns = [column.config_id] ref_columns = [table.config_items.column.id]