From c320267372b6b7c41837d327695d92eb3d90f18d Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 9 Oct 2025 09:21:22 -0600 Subject: [PATCH] resolve merge conflicts --- ...ful_shriek.sql => 0120_careful_shriek.sql} | 0 ...rant_xavin.sql => 0121_aberrant_xavin.sql} | 0 ...same_calypso.sql => 0122_same_calypso.sql} | 0 .../database/drizzle/meta/0120_snapshot.json | 12372 ++++++++-------- .../database/drizzle/meta/0121_snapshot.json | 934 +- .../database/drizzle/meta/0122_snapshot.json | 6231 ++++++++ packages/database/drizzle/meta/_journal.json | 20 +- 7 files changed, 12879 insertions(+), 6678 deletions(-) rename packages/database/drizzle/{0119_careful_shriek.sql => 0120_careful_shriek.sql} (100%) rename packages/database/drizzle/{0120_aberrant_xavin.sql => 0121_aberrant_xavin.sql} (100%) rename packages/database/drizzle/{0121_same_calypso.sql => 0122_same_calypso.sql} (100%) create mode 100644 packages/database/drizzle/meta/0122_snapshot.json diff --git a/packages/database/drizzle/0119_careful_shriek.sql b/packages/database/drizzle/0120_careful_shriek.sql similarity index 100% rename from packages/database/drizzle/0119_careful_shriek.sql rename to packages/database/drizzle/0120_careful_shriek.sql diff --git a/packages/database/drizzle/0120_aberrant_xavin.sql b/packages/database/drizzle/0121_aberrant_xavin.sql similarity index 100% rename from packages/database/drizzle/0120_aberrant_xavin.sql rename to packages/database/drizzle/0121_aberrant_xavin.sql diff --git a/packages/database/drizzle/0121_same_calypso.sql b/packages/database/drizzle/0122_same_calypso.sql similarity index 100% rename from packages/database/drizzle/0121_same_calypso.sql rename to packages/database/drizzle/0122_same_calypso.sql diff --git a/packages/database/drizzle/meta/0120_snapshot.json b/packages/database/drizzle/meta/0120_snapshot.json index 1a197b8f7..043ce2fe0 100644 --- a/packages/database/drizzle/meta/0120_snapshot.json +++ b/packages/database/drizzle/meta/0120_snapshot.json @@ -1,6201 +1,6201 @@ { - "id": "6ea1ae92-5440-4532-8f74-501949f53028", - "prevId": "3c1cc154-d1f6-484b-8aa2-0ba661948d0e", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.api_keys": { - "name": "api_keys", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" + "id": "6ea1ae92-5440-4532-8f74-501949f53028", + "prevId": "3c1cc154-d1f6-484b-8aa2-0ba661948d0e", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.api_keys": { + "name": "api_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "owner_id": { + "name": "owner_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } }, - "owner_id": { - "name": "owner_id", - "type": "uuid", - "primaryKey": false, - "notNull": true + "indexes": {}, + "foreignKeys": { + "api_keys_organization_id_fkey": { + "name": "api_keys_organization_id_fkey", + "tableFrom": "api_keys", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "api_keys_owner_id_fkey": { + "name": "api_keys_owner_id_fkey", + "tableFrom": "api_keys", + "columnsFrom": [ + "owner_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } }, - "key": { - "name": "key", - "type": "text", - "primaryKey": false, - "notNull": true + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "api_keys_key_key": { + "name": "api_keys_key_key", + "columns": [ + "key" + ], + "nullsNotDistinct": false + } }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false }, - "indexes": {}, - "foreignKeys": { - "api_keys_organization_id_fkey": { - "name": "api_keys_organization_id_fkey", - "tableFrom": "api_keys", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" + "public.asset_permissions": { + "name": "asset_permissions", + "schema": "", + "columns": { + "identity_id": { + "name": "identity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_type": { + "name": "identity_type", + "type": "identity_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "asset_permission_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } }, - "api_keys_owner_id_fkey": { - "name": "api_keys_owner_id_fkey", - "tableFrom": "api_keys", - "columnsFrom": [ - "owner_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } + "indexes": { + "idx_perm_active_asset_identity": { + "name": "idx_perm_active_asset_identity", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false + }, + "idx_perm_active_identity_asset": { + "name": "idx_perm_active_identity_asset", + "columns": [ + { + "expression": "identity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false + } + }, + "foreignKeys": { + "asset_permissions_created_by_fkey": { + "name": "asset_permissions_created_by_fkey", + "tableFrom": "asset_permissions", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "asset_permissions_updated_by_fkey": { + "name": "asset_permissions_updated_by_fkey", + "tableFrom": "asset_permissions", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "asset_permissions_pkey": { + "name": "asset_permissions_pkey", + "columns": [ + "identity_id", + "identity_type", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "api_keys_key_key": { - "name": "api_keys_key_key", - "columns": [ - "key" - ], - "nullsNotDistinct": false - } + "public.asset_search": { + "name": "asset_search", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "asset_search_asset_id_asset_type_idx": { + "name": "asset_search_asset_id_asset_type_idx", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "concurrently": false + }, + "pgroonga_content_index": { + "name": "pgroonga_content_index", + "columns": [ + { + "expression": "content", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + } + ], + "isUnique": false, + "with": {}, + "method": "pgroonga", + "concurrently": false + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false + "public.asset_search_v2": { + "name": "asset_search_v2", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additional_text": { + "name": "additional_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "pgroonga_search_title_description_index": { + "name": "pgroonga_search_title_description_index", + "columns": [ + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + }, + { + "expression": "additional_text", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + } + ], + "isUnique": false, + "with": {}, + "method": "pgroonga", + "concurrently": false + }, + "idx_as2_active_by_asset": { + "name": "idx_as2_active_by_asset", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false + }, + "idx_as2_active_by_org": { + "name": "idx_as2_active_by_org", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false + } + }, + "foreignKeys": { + "asset_search_v2_organization_id_fkey": { + "name": "asset_search_v2_organization_id_fkey", + "tableFrom": "asset_search_v2", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "asset_search_v2_created_by_fkey": { + "name": "asset_search_v2_created_by_fkey", + "tableFrom": "asset_search_v2", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "asset_search_v2_asset_type_asset_id_unique": { + "name": "asset_search_v2_asset_type_asset_id_unique", + "columns": [ + "asset_id", + "asset_type" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chats": { + "name": "chats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "most_recent_file_id": { + "name": "most_recent_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "most_recent_file_type": { + "name": "most_recent_file_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "most_recent_version_number": { + "name": "most_recent_version_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "slack_chat_authorization": { + "name": "slack_chat_authorization", + "type": "slack_chat_authorization_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "slack_thread_ts": { + "name": "slack_thread_ts", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slack_channel_id": { + "name": "slack_channel_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "chats_created_at_idx": { + "name": "chats_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "chats_created_by_idx": { + "name": "chats_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "chats_organization_id_idx": { + "name": "chats_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_chats_most_recent_file_id": { + "name": "idx_chats_most_recent_file_id", + "columns": [ + { + "expression": "most_recent_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_chats_most_recent_file_type": { + "name": "idx_chats_most_recent_file_type", + "columns": [ + { + "expression": "most_recent_file_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "chats_organization_id_fkey": { + "name": "chats_organization_id_fkey", + "tableFrom": "chats", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "chats_created_by_fkey": { + "name": "chats_created_by_fkey", + "tableFrom": "chats", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "chats_updated_by_fkey": { + "name": "chats_updated_by_fkey", + "tableFrom": "chats", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "chats_publicly_enabled_by_fkey": { + "name": "chats_publicly_enabled_by_fkey", + "tableFrom": "chats", + "columnsFrom": [ + "publicly_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "chats_workspace_sharing_enabled_by_fkey": { + "name": "chats_workspace_sharing_enabled_by_fkey", + "tableFrom": "chats", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.collections": { + "name": "collections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "collections_organization_id_fkey": { + "name": "collections_organization_id_fkey", + "tableFrom": "collections", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "collections_created_by_fkey": { + "name": "collections_created_by_fkey", + "tableFrom": "collections", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "collections_updated_by_fkey": { + "name": "collections_updated_by_fkey", + "tableFrom": "collections", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "collections_workspace_sharing_enabled_by_fkey": { + "name": "collections_workspace_sharing_enabled_by_fkey", + "tableFrom": "collections", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.collections_to_assets": { + "name": "collections_to_assets", + "schema": "", + "columns": { + "collection_id": { + "name": "collection_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_cta_active_by_asset": { + "name": "idx_cta_active_by_asset", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "collection_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"collections_to_assets\".\"deleted_at\" is null", + "concurrently": false + } + }, + "foreignKeys": { + "collections_to_assets_created_by_fkey": { + "name": "collections_to_assets_created_by_fkey", + "tableFrom": "collections_to_assets", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "collections_to_assets_updated_by_fkey": { + "name": "collections_to_assets_updated_by_fkey", + "tableFrom": "collections_to_assets", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "collections_to_assets_pkey": { + "name": "collections_to_assets_pkey", + "columns": [ + "collection_id", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dashboard_files": { + "name": "dashboard_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "filter": { + "name": "filter", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "dashboard_files_created_by_idx": { + "name": "dashboard_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dashboard_files_deleted_at_idx": { + "name": "dashboard_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dashboard_files_organization_id_idx": { + "name": "dashboard_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "dashboard_files_created_by_fkey": { + "name": "dashboard_files_created_by_fkey", + "tableFrom": "dashboard_files", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "dashboard_files_publicly_enabled_by_fkey": { + "name": "dashboard_files_publicly_enabled_by_fkey", + "tableFrom": "dashboard_files", + "columnsFrom": [ + "publicly_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "dashboard_files_workspace_sharing_enabled_by_fkey": { + "name": "dashboard_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "dashboard_files", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.data_sources": { + "name": "data_sources", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "onboarding_status": { + "name": "onboarding_status", + "type": "data_source_onboarding_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'notStarted'" + }, + "onboarding_error": { + "name": "onboarding_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'dev'" + } + }, + "indexes": {}, + "foreignKeys": { + "data_sources_organization_id_fkey": { + "name": "data_sources_organization_id_fkey", + "tableFrom": "data_sources", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "data_sources_created_by_fkey": { + "name": "data_sources_created_by_fkey", + "tableFrom": "data_sources", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "data_sources_updated_by_fkey": { + "name": "data_sources_updated_by_fkey", + "tableFrom": "data_sources", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "data_sources_name_organization_id_env_key": { + "name": "data_sources_name_organization_id_env_key", + "columns": [ + "name", + "organization_id", + "env" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_groups": { + "name": "dataset_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_groups_deleted_at_idx": { + "name": "dataset_groups_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_groups_organization_id_idx": { + "name": "dataset_groups_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "dataset_groups_organization_id_fkey": { + "name": "dataset_groups_organization_id_fkey", + "tableFrom": "dataset_groups", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": { + "dataset_groups_policy": { + "name": "dataset_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_groups_permissions": { + "name": "dataset_groups_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dataset_group_id": { + "name": "dataset_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_id": { + "name": "permission_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_type": { + "name": "permission_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_groups_permissions_dataset_group_id_idx": { + "name": "dataset_groups_permissions_dataset_group_id_idx", + "columns": [ + { + "expression": "dataset_group_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_groups_permissions_organization_id_idx": { + "name": "dataset_groups_permissions_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_groups_permissions_permission_id_idx": { + "name": "dataset_groups_permissions_permission_id_idx", + "columns": [ + { + "expression": "permission_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "dataset_groups_permissions_dataset_group_id_fkey": { + "name": "dataset_groups_permissions_dataset_group_id_fkey", + "tableFrom": "dataset_groups_permissions", + "columnsFrom": [ + "dataset_group_id" + ], + "tableTo": "dataset_groups", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "dataset_groups_permissions_organization_id_fkey": { + "name": "dataset_groups_permissions_organization_id_fkey", + "tableFrom": "dataset_groups_permissions", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_dataset_group_permission": { + "name": "unique_dataset_group_permission", + "columns": [ + "dataset_group_id", + "permission_id", + "permission_type" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_permissions": { + "name": "dataset_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_id": { + "name": "permission_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_type": { + "name": "permission_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_permissions_dataset_id_idx": { + "name": "dataset_permissions_dataset_id_idx", + "columns": [ + { + "expression": "dataset_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_permissions_deleted_at_idx": { + "name": "dataset_permissions_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_permissions_organization_id_idx": { + "name": "dataset_permissions_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "dataset_permissions_permission_lookup_idx": { + "name": "dataset_permissions_permission_lookup_idx", + "columns": [ + { + "expression": "permission_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "permission_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "dataset_permissions_organization_id_fkey": { + "name": "dataset_permissions_organization_id_fkey", + "tableFrom": "dataset_permissions", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "dataset_permissions_dataset_id_fkey": { + "name": "dataset_permissions_dataset_id_fkey", + "tableFrom": "dataset_permissions", + "columnsFrom": [ + "dataset_id" + ], + "tableTo": "datasets", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dataset_permissions_dataset_id_permission_id_permission_typ_key": { + "name": "dataset_permissions_dataset_id_permission_id_permission_typ_key", + "columns": [ + "dataset_id", + "permission_id", + "permission_type" + ], + "nullsNotDistinct": false + } + }, + "policies": { + "dataset_permissions_policy": { + "name": "dataset_permissions_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": { + "dataset_permissions_permission_type_check": { + "name": "dataset_permissions_permission_type_check", + "value": "(permission_type)::text = ANY ((ARRAY['user'::character varying, 'dataset_group'::character varying, 'permission_group'::character varying])::text[])" + } + }, + "isRLSEnabled": false + }, + "public.datasets": { + "name": "datasets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "database_name": { + "name": "database_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "when_to_use": { + "name": "when_to_use", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "when_not_to_use": { + "name": "when_not_to_use", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "dataset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "definition": { + "name": "definition", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "imported": { + "name": "imported", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "yml_file": { + "name": "yml_file", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "database_identifier": { + "name": "database_identifier", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "datasets_data_source_id_fkey": { + "name": "datasets_data_source_id_fkey", + "tableFrom": "datasets", + "columnsFrom": [ + "data_source_id" + ], + "tableTo": "data_sources", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "datasets_organization_id_fkey": { + "name": "datasets_organization_id_fkey", + "tableFrom": "datasets", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "datasets_created_by_fkey": { + "name": "datasets_created_by_fkey", + "tableFrom": "datasets", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "datasets_updated_by_fkey": { + "name": "datasets_updated_by_fkey", + "tableFrom": "datasets", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "datasets_name_schema_database_identifier_data_source_id_key": { + "name": "datasets_name_schema_database_identifier_data_source_id_key", + "columns": [ + "name", + "schema", + "database_identifier", + "data_source_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.datasets_to_dataset_groups": { + "name": "datasets_to_dataset_groups", + "schema": "", + "columns": { + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_group_id": { + "name": "dataset_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "datasets_to_dataset_groups_dataset_group_id_idx": { + "name": "datasets_to_dataset_groups_dataset_group_id_idx", + "columns": [ + { + "expression": "dataset_group_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "datasets_to_dataset_groups_dataset_id_fkey": { + "name": "datasets_to_dataset_groups_dataset_id_fkey", + "tableFrom": "datasets_to_dataset_groups", + "columnsFrom": [ + "dataset_id" + ], + "tableTo": "datasets", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "datasets_to_dataset_groups_dataset_group_id_fkey": { + "name": "datasets_to_dataset_groups_dataset_group_id_fkey", + "tableFrom": "datasets_to_dataset_groups", + "columnsFrom": [ + "dataset_group_id" + ], + "tableTo": "dataset_groups", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "datasets_to_dataset_groups_pkey": { + "name": "datasets_to_dataset_groups_pkey", + "columns": [ + "dataset_id", + "dataset_group_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "datasets_to_dataset_groups_policy": { + "name": "datasets_to_dataset_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.datasets_to_permission_groups": { + "name": "datasets_to_permission_groups", + "schema": "", + "columns": { + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "datasets_to_permission_groups_dataset_id_fkey": { + "name": "datasets_to_permission_groups_dataset_id_fkey", + "tableFrom": "datasets_to_permission_groups", + "columnsFrom": [ + "dataset_id" + ], + "tableTo": "datasets", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "datasets_to_permission_groups_permission_group_id_fkey": { + "name": "datasets_to_permission_groups_permission_group_id_fkey", + "tableFrom": "datasets_to_permission_groups", + "columnsFrom": [ + "permission_group_id" + ], + "tableTo": "permission_groups", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "datasets_to_permission_groups_pkey": { + "name": "datasets_to_permission_groups_pkey", + "columns": [ + "dataset_id", + "permission_group_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "datasets_to_permission_groups_policy": { + "name": "datasets_to_permission_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.docs": { + "name": "docs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "docs_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'normal'" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "docs_organization_id_fkey": { + "name": "docs_organization_id_fkey", + "tableFrom": "docs", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "docs_name_organization_id_key": { + "name": "docs_name_organization_id_key", + "columns": [ + "name", + "organization_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_integrations": { + "name": "github_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "installation_id": { + "name": "installation_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "app_id": { + "name": "app_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "github_org_id": { + "name": "github_org_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "github_org_name": { + "name": "github_org_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "token_vault_key": { + "name": "token_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "webhook_secret_vault_key": { + "name": "webhook_secret_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "repository_permissions": { + "name": "repository_permissions", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "status": { + "name": "status", + "type": "github_integration_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "installed_at": { + "name": "installed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_github_integrations_org_id": { + "name": "idx_github_integrations_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_github_integrations_installation_id": { + "name": "idx_github_integrations_installation_id", + "columns": [ + { + "expression": "installation_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_github_integrations_github_org_id": { + "name": "idx_github_integrations_github_org_id", + "columns": [ + { + "expression": "github_org_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "github_integrations_organization_id_fkey": { + "name": "github_integrations_organization_id_fkey", + "tableFrom": "github_integrations", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "github_integrations_user_id_fkey": { + "name": "github_integrations_user_id_fkey", + "tableFrom": "github_integrations", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_integrations_token_vault_key_unique": { + "name": "github_integrations_token_vault_key_unique", + "columns": [ + "token_vault_key" + ], + "nullsNotDistinct": false + }, + "github_integrations_org_installation_key": { + "name": "github_integrations_org_installation_key", + "columns": [ + "organization_id", + "installation_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs_write_back_configs": { + "name": "logs_write_back_configs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "database": { + "name": "database", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'buster_query_logs'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "logs_write_back_configs_org_unique": { + "name": "logs_write_back_configs_org_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"logs_write_back_configs\".\"deleted_at\" IS NULL", + "concurrently": false + }, + "idx_logs_write_back_configs_org_id": { + "name": "idx_logs_write_back_configs_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_logs_write_back_configs_data_source_id": { + "name": "idx_logs_write_back_configs_data_source_id", + "columns": [ + { + "expression": "data_source_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_logs_write_back_configs_deleted_at": { + "name": "idx_logs_write_back_configs_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "logs_write_back_configs_organization_id_fkey": { + "name": "logs_write_back_configs_organization_id_fkey", + "tableFrom": "logs_write_back_configs", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "logs_write_back_configs_data_source_id_fkey": { + "name": "logs_write_back_configs_data_source_id_fkey", + "tableFrom": "logs_write_back_configs", + "columnsFrom": [ + "data_source_id" + ], + "tableTo": "data_sources", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages": { + "name": "messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "request_message": { + "name": "request_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_messages": { + "name": "response_messages", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "message_analysis_mode": { + "name": "message_analysis_mode", + "type": "message_analysis_mode_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'auto'" + }, + "reasoning": { + "name": "reasoning", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "raw_llm_messages": { + "name": "raw_llm_messages", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "final_reasoning_message": { + "name": "final_reasoning_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "feedback": { + "name": "feedback", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_completed": { + "name": "is_completed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "post_processing_message": { + "name": "post_processing_message", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "trigger_run_id": { + "name": "trigger_run_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "messages_chat_id_idx": { + "name": "messages_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_created_at_idx": { + "name": "messages_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_created_by_idx": { + "name": "messages_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_deleted_at_idx": { + "name": "messages_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_raw_llm_messages_gin_idx": { + "name": "messages_raw_llm_messages_gin_idx", + "columns": [ + { + "expression": "raw_llm_messages", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + }, + "messages_response_messages_gin_idx": { + "name": "messages_response_messages_gin_idx", + "columns": [ + { + "expression": "response_messages", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + }, + "messages_reasoning_gin_idx": { + "name": "messages_reasoning_gin_idx", + "columns": [ + { + "expression": "reasoning", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + }, + "messages_id_deleted_at_idx": { + "name": "messages_id_deleted_at_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "messages_chat_id_fkey": { + "name": "messages_chat_id_fkey", + "tableFrom": "messages", + "columnsFrom": [ + "chat_id" + ], + "tableTo": "chats", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "messages_created_by_fkey": { + "name": "messages_created_by_fkey", + "tableFrom": "messages", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages_to_files": { + "name": "messages_to_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_duplicate": { + "name": "is_duplicate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "version_number": { + "name": "version_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + } + }, + "indexes": { + "messages_files_file_id_idx": { + "name": "messages_files_file_id_idx", + "columns": [ + { + "expression": "file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_files_message_id_idx": { + "name": "messages_files_message_id_idx", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_mtf_active_by_file": { + "name": "idx_mtf_active_by_file", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"messages_to_files\".\"deleted_at\" is null", + "concurrently": false + } + }, + "foreignKeys": { + "messages_to_files_message_id_fkey": { + "name": "messages_to_files_message_id_fkey", + "tableFrom": "messages_to_files", + "columnsFrom": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "messages_to_files_message_id_file_id_key": { + "name": "messages_to_files_message_id_file_id_key", + "columns": [ + "message_id", + "file_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages_to_slack_messages": { + "name": "messages_to_slack_messages", + "schema": "", + "columns": { + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slack_message_id": { + "name": "slack_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "messages_to_slack_messages_message_id_idx": { + "name": "messages_to_slack_messages_message_id_idx", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "messages_to_slack_messages_slack_message_id_idx": { + "name": "messages_to_slack_messages_slack_message_id_idx", + "columns": [ + { + "expression": "slack_message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "messages_to_slack_messages_message_id_fkey": { + "name": "messages_to_slack_messages_message_id_fkey", + "tableFrom": "messages_to_slack_messages", + "columnsFrom": [ + "message_id" + ], + "tableTo": "messages", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "messages_to_slack_messages_slack_message_id_fkey": { + "name": "messages_to_slack_messages_slack_message_id_fkey", + "tableFrom": "messages_to_slack_messages", + "columnsFrom": [ + "slack_message_id" + ], + "tableTo": "slack_message_tracking", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "messages_to_slack_messages_pkey": { + "name": "messages_to_slack_messages_pkey", + "columns": [ + "message_id", + "slack_message_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files": { + "name": "metric_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "verification": { + "name": "verification", + "type": "verification_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'notRequested'" + }, + "evaluation_obj": { + "name": "evaluation_obj", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "evaluation_summary": { + "name": "evaluation_summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evaluation_score": { + "name": "evaluation_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "data_metadata": { + "name": "data_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "metric_files_created_by_idx": { + "name": "metric_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_data_metadata_idx": { + "name": "metric_files_data_metadata_idx", + "columns": [ + { + "expression": "data_metadata", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "gin", + "concurrently": false + }, + "metric_files_deleted_at_idx": { + "name": "metric_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_organization_id_idx": { + "name": "metric_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "metric_files_created_by_fkey": { + "name": "metric_files_created_by_fkey", + "tableFrom": "metric_files", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "metric_files_publicly_enabled_by_fkey": { + "name": "metric_files_publicly_enabled_by_fkey", + "tableFrom": "metric_files", + "columnsFrom": [ + "publicly_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "fk_data_source": { + "name": "fk_data_source", + "tableFrom": "metric_files", + "columnsFrom": [ + "data_source_id" + ], + "tableTo": "data_sources", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "metric_files_workspace_sharing_enabled_by_fkey": { + "name": "metric_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "metric_files", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_dashboard_files": { + "name": "metric_files_to_dashboard_files", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dashboard_file_id": { + "name": "dashboard_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "metric_files_to_dashboard_files_dashboard_id_idx": { + "name": "metric_files_to_dashboard_files_dashboard_id_idx", + "columns": [ + { + "expression": "dashboard_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_to_dashboard_files_deleted_at_idx": { + "name": "metric_files_to_dashboard_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_to_dashboard_files_metric_id_idx": { + "name": "metric_files_to_dashboard_files_metric_id_idx", + "columns": [ + { + "expression": "metric_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "metric_files_to_dashboard_files_metric_file_id_fkey": { + "name": "metric_files_to_dashboard_files_metric_file_id_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "columnsFrom": [ + "metric_file_id" + ], + "tableTo": "metric_files", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "metric_files_to_dashboard_files_dashboard_file_id_fkey": { + "name": "metric_files_to_dashboard_files_dashboard_file_id_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "columnsFrom": [ + "dashboard_file_id" + ], + "tableTo": "dashboard_files", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "metric_files_to_dashboard_files_created_by_fkey": { + "name": "metric_files_to_dashboard_files_created_by_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "metric_files_to_dashboard_files_pkey": { + "name": "metric_files_to_dashboard_files_pkey", + "columns": [ + "metric_file_id", + "dashboard_file_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_datasets": { + "name": "metric_files_to_datasets", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "metric_version_number": { + "name": "metric_version_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "fk_metric_file": { + "name": "fk_metric_file", + "tableFrom": "metric_files_to_datasets", + "columnsFrom": [ + "metric_file_id" + ], + "tableTo": "metric_files", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "fk_dataset": { + "name": "fk_dataset", + "tableFrom": "metric_files_to_datasets", + "columnsFrom": [ + "dataset_id" + ], + "tableTo": "datasets", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "metric_files_to_datasets_pkey": { + "name": "metric_files_to_datasets_pkey", + "columns": [ + "metric_file_id", + "dataset_id", + "metric_version_number" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_report_files": { + "name": "metric_files_to_report_files", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "report_file_id": { + "name": "report_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "metric_files_to_report_files_report_id_idx": { + "name": "metric_files_to_report_files_report_id_idx", + "columns": [ + { + "expression": "report_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_to_report_files_deleted_at_idx": { + "name": "metric_files_to_report_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "metric_files_to_report_files_metric_id_idx": { + "name": "metric_files_to_report_files_metric_id_idx", + "columns": [ + { + "expression": "metric_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "metric_files_to_report_files_metric_file_id_fkey": { + "name": "metric_files_to_report_files_metric_file_id_fkey", + "tableFrom": "metric_files_to_report_files", + "columnsFrom": [ + "metric_file_id" + ], + "tableTo": "metric_files", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "metric_files_to_report_files_report_file_id_fkey": { + "name": "metric_files_to_report_files_report_file_id_fkey", + "tableFrom": "metric_files_to_report_files", + "columnsFrom": [ + "report_file_id" + ], + "tableTo": "report_files", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "metric_files_to_report_files_created_by_fkey": { + "name": "metric_files_to_report_files_created_by_fkey", + "tableFrom": "metric_files_to_report_files", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "metric_files_to_report_files_pkey": { + "name": "metric_files_to_report_files_pkey", + "columns": [ + "metric_file_id", + "report_file_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organizations": { + "name": "organizations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payment_required": { + "name": "payment_required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "domains": { + "name": "domains", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "restrict_new_user_invitations": { + "name": "restrict_new_user_invitations", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "default_role": { + "name": "default_role", + "type": "user_organization_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'restricted_querier'" + }, + "organization_color_palettes": { + "name": "organization_color_palettes", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"selectedId\": null, \"palettes\": [], \"selectedDictionaryPalette\": null}'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organizations_name_key": { + "name": "organizations_name_key", + "columns": [ + "name" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups": { + "name": "permission_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "permission_groups_organization_id_fkey": { + "name": "permission_groups_organization_id_fkey", + "tableFrom": "permission_groups", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "permission_groups_created_by_fkey": { + "name": "permission_groups_created_by_fkey", + "tableFrom": "permission_groups", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "permission_groups_updated_by_fkey": { + "name": "permission_groups_updated_by_fkey", + "tableFrom": "permission_groups", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups_to_identities": { + "name": "permission_groups_to_identities", + "schema": "", + "columns": { + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_id": { + "name": "identity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_type": { + "name": "identity_type", + "type": "identity_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "permission_groups_to_identities_created_by_fkey": { + "name": "permission_groups_to_identities_created_by_fkey", + "tableFrom": "permission_groups_to_identities", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "permission_groups_to_identities_updated_by_fkey": { + "name": "permission_groups_to_identities_updated_by_fkey", + "tableFrom": "permission_groups_to_identities", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "permission_groups_to_identities_pkey": { + "name": "permission_groups_to_identities_pkey", + "columns": [ + "permission_group_id", + "identity_id", + "identity_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups_to_users": { + "name": "permission_groups_to_users", + "schema": "", + "columns": { + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permission_groups_to_users_user_id_idx": { + "name": "permission_groups_to_users_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "permission_groups_to_users_permission_group_id_fkey": { + "name": "permission_groups_to_users_permission_group_id_fkey", + "tableFrom": "permission_groups_to_users", + "columnsFrom": [ + "permission_group_id" + ], + "tableTo": "permission_groups", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "permission_groups_to_users_user_id_fkey": { + "name": "permission_groups_to_users_user_id_fkey", + "tableFrom": "permission_groups_to_users", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "permission_groups_to_users_pkey": { + "name": "permission_groups_to_users_pkey", + "columns": [ + "permission_group_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "permission_groups_to_users_policy": { + "name": "permission_groups_to_users_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.report_files": { + "name": "report_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "report_files_created_by_idx": { + "name": "report_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "report_files_deleted_at_idx": { + "name": "report_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "report_files_organization_id_idx": { + "name": "report_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "report_files_created_by_fkey": { + "name": "report_files_created_by_fkey", + "tableFrom": "report_files", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "report_files_publicly_enabled_by_fkey": { + "name": "report_files_publicly_enabled_by_fkey", + "tableFrom": "report_files", + "columnsFrom": [ + "publicly_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "report_files_workspace_sharing_enabled_by_fkey": { + "name": "report_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "report_files", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "report_files_organization_id_fkey": { + "name": "report_files_organization_id_fkey", + "tableFrom": "report_files", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.s3_integrations": { + "name": "s3_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "storage_provider_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_s3_integrations_organization_id": { + "name": "idx_s3_integrations_organization_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_s3_integrations_deleted_at": { + "name": "idx_s3_integrations_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "s3_integrations_organization_id_fkey": { + "name": "s3_integrations_organization_id_fkey", + "tableFrom": "s3_integrations", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shortcuts": { + "name": "shortcuts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "instructions": { + "name": "instructions", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "share_with_workspace": { + "name": "share_with_workspace", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "shortcuts_org_user_idx": { + "name": "shortcuts_org_user_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "shortcuts_name_idx": { + "name": "shortcuts_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "shortcuts_workspace_unique": { + "name": "shortcuts_workspace_unique", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"shortcuts\".\"share_with_workspace\" = true", + "concurrently": false + } + }, + "foreignKeys": { + "shortcuts_created_by_fkey": { + "name": "shortcuts_created_by_fkey", + "tableFrom": "shortcuts", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "shortcuts_updated_by_fkey": { + "name": "shortcuts_updated_by_fkey", + "tableFrom": "shortcuts", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "shortcuts_organization_id_fkey": { + "name": "shortcuts_organization_id_fkey", + "tableFrom": "shortcuts", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shortcuts_personal_unique": { + "name": "shortcuts_personal_unique", + "columns": [ + "name", + "organization_id", + "created_by" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.slack_integrations": { + "name": "slack_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "oauth_state": { + "name": "oauth_state", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "oauth_expires_at": { + "name": "oauth_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "oauth_metadata": { + "name": "oauth_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "team_id": { + "name": "team_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "team_name": { + "name": "team_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "team_domain": { + "name": "team_domain", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "enterprise_id": { + "name": "enterprise_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "bot_user_id": { + "name": "bot_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_vault_key": { + "name": "token_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "installed_by_slack_user_id": { + "name": "installed_by_slack_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "installed_at": { + "name": "installed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "slack_integration_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "default_channel": { + "name": "default_channel", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "default_sharing_permissions": { + "name": "default_sharing_permissions", + "type": "slack_sharing_permission_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'shareWithChannel'" + } + }, + "indexes": { + "idx_slack_integrations_org_id": { + "name": "idx_slack_integrations_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_slack_integrations_team_id": { + "name": "idx_slack_integrations_team_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_slack_integrations_oauth_state": { + "name": "idx_slack_integrations_oauth_state", + "columns": [ + { + "expression": "oauth_state", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_slack_integrations_oauth_expires": { + "name": "idx_slack_integrations_oauth_expires", + "columns": [ + { + "expression": "oauth_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "slack_integrations_organization_id_fkey": { + "name": "slack_integrations_organization_id_fkey", + "tableFrom": "slack_integrations", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "slack_integrations_user_id_fkey": { + "name": "slack_integrations_user_id_fkey", + "tableFrom": "slack_integrations", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slack_integrations_oauth_state_unique": { + "name": "slack_integrations_oauth_state_unique", + "columns": [ + "oauth_state" + ], + "nullsNotDistinct": false + }, + "slack_integrations_token_vault_key_unique": { + "name": "slack_integrations_token_vault_key_unique", + "columns": [ + "token_vault_key" + ], + "nullsNotDistinct": false + }, + "slack_integrations_org_team_key": { + "name": "slack_integrations_org_team_key", + "columns": [ + "organization_id", + "team_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": { + "slack_integrations_status_check": { + "name": "slack_integrations_status_check", + "value": "(status = 'pending' AND oauth_state IS NOT NULL) OR (status != 'pending' AND team_id IS NOT NULL)" + } + }, + "isRLSEnabled": false + }, + "public.slack_message_tracking": { + "name": "slack_message_tracking", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "integration_id": { + "name": "integration_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "internal_message_id": { + "name": "internal_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slack_channel_id": { + "name": "slack_channel_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "slack_message_ts": { + "name": "slack_message_ts", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "slack_thread_ts": { + "name": "slack_thread_ts", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "message_type": { + "name": "message_type", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sender_info": { + "name": "sender_info", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "sent_at": { + "name": "sent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_message_tracking_integration": { + "name": "idx_message_tracking_integration", + "columns": [ + { + "expression": "integration_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_message_tracking_channel": { + "name": "idx_message_tracking_channel", + "columns": [ + { + "expression": "slack_channel_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "idx_message_tracking_thread": { + "name": "idx_message_tracking_thread", + "columns": [ + { + "expression": "slack_thread_ts", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + } + }, + "foreignKeys": { + "slack_message_tracking_integration_id_fkey": { + "name": "slack_message_tracking_integration_id_fkey", + "tableFrom": "slack_message_tracking", + "columnsFrom": [ + "integration_id" + ], + "tableTo": "slack_integrations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slack_message_tracking_internal_message_id_unique": { + "name": "slack_message_tracking_internal_message_id_unique", + "columns": [ + "internal_message_id" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.teams": { + "name": "teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sharing_setting": { + "name": "sharing_setting", + "type": "sharing_setting_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "edit_sql": { + "name": "edit_sql", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "upload_csv": { + "name": "upload_csv", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "export_assets": { + "name": "export_assets", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "email_slack_enabled": { + "name": "email_slack_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "teams_organization_id_fkey": { + "name": "teams_organization_id_fkey", + "tableFrom": "teams", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "teams_created_by_fkey": { + "name": "teams_created_by_fkey", + "tableFrom": "teams", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "teams_name_key": { + "name": "teams_name_key", + "columns": [ + "name" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.teams_to_users": { + "name": "teams_to_users", + "schema": "", + "columns": { + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "team_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "teams_to_users_team_id_fkey": { + "name": "teams_to_users_team_id_fkey", + "tableFrom": "teams_to_users", + "columnsFrom": [ + "team_id" + ], + "tableTo": "teams", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "teams_to_users_user_id_fkey": { + "name": "teams_to_users_user_id_fkey", + "tableFrom": "teams_to_users", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "teams_to_users_pkey": { + "name": "teams_to_users_pkey", + "columns": [ + "team_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_favorites": { + "name": "user_favorites", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "order_index": { + "name": "order_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_favorites_user_id_fkey": { + "name": "user_favorites_user_id_fkey", + "tableFrom": "user_favorites", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "user_favorites_pkey": { + "name": "user_favorites_pkey", + "columns": [ + "user_id", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "attributes": { + "name": "attributes", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "avatar_url": { + "name": "avatar_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "suggested_prompts": { + "name": "suggested_prompts", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\n \"suggestedPrompts\": {\n \"report\": [\n \"provide a trend analysis of quarterly profits\",\n \"evaluate product performance across regions\"\n ],\n \"dashboard\": [\n \"create a sales performance dashboard\",\n \"design a revenue forecast dashboard\"\n ],\n \"visualization\": [\n \"create a metric for monthly sales\",\n \"show top vendors by purchase volume\"\n ],\n \"help\": [\n \"what types of analyses can you perform?\",\n \"what questions can I ask buster?\",\n \"what data models are available for queries?\",\n \"can you explain your forecasting capabilities?\"\n ]\n },\n \"updatedAt\": \"2024-01-01T00:00:00.000Z\"\n }'::jsonb" + }, + "personalization_enabled": { + "name": "personalization_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "personalization_config": { + "name": "personalization_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "last_used_shortcuts": { + "name": "last_used_shortcuts", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_key": { + "name": "users_email_key", + "columns": [ + "email" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users_to_organizations": { + "name": "users_to_organizations", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "user_organization_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'querier'" + }, + "sharing_setting": { + "name": "sharing_setting", + "type": "sharing_setting_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "edit_sql": { + "name": "edit_sql", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "upload_csv": { + "name": "upload_csv", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "export_assets": { + "name": "export_assets", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "email_slack_enabled": { + "name": "email_slack_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deleted_by": { + "name": "deleted_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "user_organization_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + } + }, + "indexes": { + "idx_uto_active_by_user": { + "name": "idx_uto_active_by_user", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "where": "\"users_to_organizations\".\"deleted_at\" is null", + "concurrently": false + } + }, + "foreignKeys": { + "users_to_organizations_organization_id_fkey": { + "name": "users_to_organizations_organization_id_fkey", + "tableFrom": "users_to_organizations", + "columnsFrom": [ + "organization_id" + ], + "tableTo": "organizations", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "users_to_organizations_user_id_fkey": { + "name": "users_to_organizations_user_id_fkey", + "tableFrom": "users_to_organizations", + "columnsFrom": [ + "user_id" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "users_to_organizations_created_by_fkey": { + "name": "users_to_organizations_created_by_fkey", + "tableFrom": "users_to_organizations", + "columnsFrom": [ + "created_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "users_to_organizations_updated_by_fkey": { + "name": "users_to_organizations_updated_by_fkey", + "tableFrom": "users_to_organizations", + "columnsFrom": [ + "updated_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + }, + "users_to_organizations_deleted_by_fkey": { + "name": "users_to_organizations_deleted_by_fkey", + "tableFrom": "users_to_organizations", + "columnsFrom": [ + "deleted_by" + ], + "tableTo": "users", + "columnsTo": [ + "id" + ], + "onUpdate": "cascade", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": { + "users_to_organizations_pkey": { + "name": "users_to_organizations_pkey", + "columns": [ + "user_id", + "organization_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } }, - "public.asset_permissions": { - "name": "asset_permissions", - "schema": "", - "columns": { - "identity_id": { - "name": "identity_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "identity_type": { - "name": "identity_type", - "type": "identity_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "asset_id": { - "name": "asset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_type": { - "name": "asset_type", - "type": "asset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "asset_permission_role_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - } + "enums": { + "public.asset_permission_role_enum": { + "name": "asset_permission_role_enum", + "schema": "public", + "values": [ + "owner", + "viewer", + "can_view", + "can_filter", + "can_edit", + "full_access" + ] }, - "indexes": { - "idx_perm_active_asset_identity": { - "name": "idx_perm_active_asset_identity", - "columns": [ - { - "expression": "asset_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "asset_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"asset_permissions\".\"deleted_at\" is null", - "concurrently": false - }, - "idx_perm_active_identity_asset": { - "name": "idx_perm_active_identity_asset", - "columns": [ - { - "expression": "identity_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "identity_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "asset_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "asset_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"asset_permissions\".\"deleted_at\" is null", - "concurrently": false - } + "public.asset_type_enum": { + "name": "asset_type_enum", + "schema": "public", + "values": [ + "chat", + "metric_file", + "dashboard_file", + "report_file", + "collection" + ] }, - "foreignKeys": { - "asset_permissions_created_by_fkey": { - "name": "asset_permissions_created_by_fkey", - "tableFrom": "asset_permissions", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "asset_permissions_updated_by_fkey": { - "name": "asset_permissions_updated_by_fkey", - "tableFrom": "asset_permissions", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } + "public.data_source_onboarding_status_enum": { + "name": "data_source_onboarding_status_enum", + "schema": "public", + "values": [ + "notStarted", + "inProgress", + "completed", + "failed" + ] }, - "compositePrimaryKeys": { - "asset_permissions_pkey": { - "name": "asset_permissions_pkey", - "columns": [ - "identity_id", - "identity_type", - "asset_id", - "asset_type" - ] - } + "public.dataset_type_enum": { + "name": "dataset_type_enum", + "schema": "public", + "values": [ + "table", + "view", + "materializedView" + ] }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false + "public.docs_type_enum": { + "name": "docs_type_enum", + "schema": "public", + "values": [ + "analyst", + "normal" + ] + }, + "public.github_integration_status_enum": { + "name": "github_integration_status_enum", + "schema": "public", + "values": [ + "pending", + "active", + "suspended", + "revoked" + ] + }, + "public.identity_type_enum": { + "name": "identity_type_enum", + "schema": "public", + "values": [ + "user", + "team", + "organization" + ] + }, + "public.message_analysis_mode_enum": { + "name": "message_analysis_mode_enum", + "schema": "public", + "values": [ + "auto", + "standard", + "investigation" + ] + }, + "public.message_feedback_enum": { + "name": "message_feedback_enum", + "schema": "public", + "values": [ + "positive", + "negative" + ] + }, + "public.sharing_setting_enum": { + "name": "sharing_setting_enum", + "schema": "public", + "values": [ + "none", + "team", + "organization", + "public" + ] + }, + "public.slack_chat_authorization_enum": { + "name": "slack_chat_authorization_enum", + "schema": "public", + "values": [ + "unauthorized", + "authorized", + "auto_added" + ] + }, + "public.slack_integration_status_enum": { + "name": "slack_integration_status_enum", + "schema": "public", + "values": [ + "pending", + "active", + "failed", + "revoked" + ] + }, + "public.slack_sharing_permission_enum": { + "name": "slack_sharing_permission_enum", + "schema": "public", + "values": [ + "shareWithWorkspace", + "shareWithChannel", + "noSharing" + ] + }, + "public.storage_provider_enum": { + "name": "storage_provider_enum", + "schema": "public", + "values": [ + "s3", + "r2", + "gcs" + ] + }, + "public.stored_values_status_enum": { + "name": "stored_values_status_enum", + "schema": "public", + "values": [ + "syncing", + "success", + "failed" + ] + }, + "public.table_type_enum": { + "name": "table_type_enum", + "schema": "public", + "values": [ + "TABLE", + "VIEW", + "MATERIALIZED_VIEW", + "EXTERNAL_TABLE", + "TEMPORARY_TABLE" + ] + }, + "public.team_role_enum": { + "name": "team_role_enum", + "schema": "public", + "values": [ + "manager", + "member", + "none" + ] + }, + "public.user_organization_role_enum": { + "name": "user_organization_role_enum", + "schema": "public", + "values": [ + "workspace_admin", + "data_admin", + "querier", + "restricted_querier", + "viewer" + ] + }, + "public.user_organization_status_enum": { + "name": "user_organization_status_enum", + "schema": "public", + "values": [ + "active", + "inactive", + "pending", + "guest" + ] + }, + "public.verification_enum": { + "name": "verification_enum", + "schema": "public", + "values": [ + "verified", + "backlogged", + "inReview", + "requested", + "notRequested" + ] + }, + "public.workspace_sharing_enum": { + "name": "workspace_sharing_enum", + "schema": "public", + "values": [ + "none", + "can_view", + "can_edit", + "full_access" + ] + } }, - "public.asset_search": { - "name": "asset_search", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "asset_id": { - "name": "asset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_type": { - "name": "asset_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "asset_search_asset_id_asset_type_idx": { - "name": "asset_search_asset_id_asset_type_idx", - "columns": [ - { - "expression": "asset_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - }, - { - "expression": "asset_type", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "concurrently": false - }, - "pgroonga_content_index": { - "name": "pgroonga_content_index", - "columns": [ - { - "expression": "content", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "pgroonga_text_full_text_search_ops_v2" - } - ], - "isUnique": false, - "with": {}, - "method": "pgroonga", - "concurrently": false - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.asset_search_v2": { - "name": "asset_search_v2", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "asset_type": { - "name": "asset_type", - "type": "asset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "asset_id": { - "name": "asset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "additional_text": { - "name": "additional_text", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "pgroonga_search_title_description_index": { - "name": "pgroonga_search_title_description_index", - "columns": [ - { - "expression": "title", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "pgroonga_text_full_text_search_ops_v2" - }, - { - "expression": "additional_text", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "pgroonga_text_full_text_search_ops_v2" - } - ], - "isUnique": false, - "with": {}, - "method": "pgroonga", - "concurrently": false - }, - "idx_as2_active_by_asset": { - "name": "idx_as2_active_by_asset", - "columns": [ - { - "expression": "asset_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "asset_type", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"asset_search_v2\".\"deleted_at\" is null", - "concurrently": false - }, - "idx_as2_active_by_org": { - "name": "idx_as2_active_by_org", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"asset_search_v2\".\"deleted_at\" is null", - "concurrently": false - } - }, - "foreignKeys": { - "asset_search_v2_organization_id_fkey": { - "name": "asset_search_v2_organization_id_fkey", - "tableFrom": "asset_search_v2", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "asset_search_v2_created_by_fkey": { - "name": "asset_search_v2_created_by_fkey", - "tableFrom": "asset_search_v2", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "asset_search_v2_asset_type_asset_id_unique": { - "name": "asset_search_v2_asset_type_asset_id_unique", - "columns": [ - "asset_id", - "asset_type" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.chats": { - "name": "chats", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "publicly_accessible": { - "name": "publicly_accessible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "publicly_enabled_by": { - "name": "publicly_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "public_expiry_date": { - "name": "public_expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "public_password": { - "name": "public_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "most_recent_file_id": { - "name": "most_recent_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "most_recent_file_type": { - "name": "most_recent_file_type", - "type": "asset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "most_recent_version_number": { - "name": "most_recent_version_number", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "slack_chat_authorization": { - "name": "slack_chat_authorization", - "type": "slack_chat_authorization_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": false - }, - "slack_thread_ts": { - "name": "slack_thread_ts", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "slack_channel_id": { - "name": "slack_channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing": { - "name": "workspace_sharing", - "type": "workspace_sharing_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "workspace_sharing_enabled_by": { - "name": "workspace_sharing_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing_enabled_at": { - "name": "workspace_sharing_enabled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "saved_to_library": { - "name": "saved_to_library", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "chats_created_at_idx": { - "name": "chats_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "chats_created_by_idx": { - "name": "chats_created_by_idx", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "chats_organization_id_idx": { - "name": "chats_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_chats_most_recent_file_id": { - "name": "idx_chats_most_recent_file_id", - "columns": [ - { - "expression": "most_recent_file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_chats_most_recent_file_type": { - "name": "idx_chats_most_recent_file_type", - "columns": [ - { - "expression": "most_recent_file_type", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "chats_organization_id_fkey": { - "name": "chats_organization_id_fkey", - "tableFrom": "chats", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "chats_created_by_fkey": { - "name": "chats_created_by_fkey", - "tableFrom": "chats", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "chats_updated_by_fkey": { - "name": "chats_updated_by_fkey", - "tableFrom": "chats", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "chats_publicly_enabled_by_fkey": { - "name": "chats_publicly_enabled_by_fkey", - "tableFrom": "chats", - "columnsFrom": [ - "publicly_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "chats_workspace_sharing_enabled_by_fkey": { - "name": "chats_workspace_sharing_enabled_by_fkey", - "tableFrom": "chats", - "columnsFrom": [ - "workspace_sharing_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.collections": { - "name": "collections", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "workspace_sharing": { - "name": "workspace_sharing", - "type": "workspace_sharing_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "workspace_sharing_enabled_by": { - "name": "workspace_sharing_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing_enabled_at": { - "name": "workspace_sharing_enabled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "collections_organization_id_fkey": { - "name": "collections_organization_id_fkey", - "tableFrom": "collections", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "collections_created_by_fkey": { - "name": "collections_created_by_fkey", - "tableFrom": "collections", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "collections_updated_by_fkey": { - "name": "collections_updated_by_fkey", - "tableFrom": "collections", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "collections_workspace_sharing_enabled_by_fkey": { - "name": "collections_workspace_sharing_enabled_by_fkey", - "tableFrom": "collections", - "columnsFrom": [ - "workspace_sharing_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.collections_to_assets": { - "name": "collections_to_assets", - "schema": "", - "columns": { - "collection_id": { - "name": "collection_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_id": { - "name": "asset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_type": { - "name": "asset_type", - "type": "asset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_cta_active_by_asset": { - "name": "idx_cta_active_by_asset", - "columns": [ - { - "expression": "asset_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "asset_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "collection_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"collections_to_assets\".\"deleted_at\" is null", - "concurrently": false - } - }, - "foreignKeys": { - "collections_to_assets_created_by_fkey": { - "name": "collections_to_assets_created_by_fkey", - "tableFrom": "collections_to_assets", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "collections_to_assets_updated_by_fkey": { - "name": "collections_to_assets_updated_by_fkey", - "tableFrom": "collections_to_assets", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "collections_to_assets_pkey": { - "name": "collections_to_assets_pkey", - "columns": [ - "collection_id", - "asset_id", - "asset_type" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dashboard_files": { - "name": "dashboard_files", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "filter": { - "name": "filter", - "type": "varchar", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publicly_accessible": { - "name": "publicly_accessible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "publicly_enabled_by": { - "name": "publicly_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "public_expiry_date": { - "name": "public_expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "version_history": { - "name": "version_history", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "public_password": { - "name": "public_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing": { - "name": "workspace_sharing", - "type": "workspace_sharing_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "workspace_sharing_enabled_by": { - "name": "workspace_sharing_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing_enabled_at": { - "name": "workspace_sharing_enabled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "saved_to_library": { - "name": "saved_to_library", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "dashboard_files_created_by_idx": { - "name": "dashboard_files_created_by_idx", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dashboard_files_deleted_at_idx": { - "name": "dashboard_files_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dashboard_files_organization_id_idx": { - "name": "dashboard_files_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "dashboard_files_created_by_fkey": { - "name": "dashboard_files_created_by_fkey", - "tableFrom": "dashboard_files", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "dashboard_files_publicly_enabled_by_fkey": { - "name": "dashboard_files_publicly_enabled_by_fkey", - "tableFrom": "dashboard_files", - "columnsFrom": [ - "publicly_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "dashboard_files_workspace_sharing_enabled_by_fkey": { - "name": "dashboard_files_workspace_sharing_enabled_by_fkey", - "tableFrom": "dashboard_files", - "columnsFrom": [ - "workspace_sharing_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.data_sources": { - "name": "data_sources", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "secret_id": { - "name": "secret_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "onboarding_status": { - "name": "onboarding_status", - "type": "data_source_onboarding_status_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'notStarted'" - }, - "onboarding_error": { - "name": "onboarding_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "env": { - "name": "env", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'dev'" - } - }, - "indexes": {}, - "foreignKeys": { - "data_sources_organization_id_fkey": { - "name": "data_sources_organization_id_fkey", - "tableFrom": "data_sources", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "data_sources_created_by_fkey": { - "name": "data_sources_created_by_fkey", - "tableFrom": "data_sources", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "data_sources_updated_by_fkey": { - "name": "data_sources_updated_by_fkey", - "tableFrom": "data_sources", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "data_sources_name_organization_id_env_key": { - "name": "data_sources_name_organization_id_env_key", - "columns": [ - "name", - "organization_id", - "env" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dataset_groups": { - "name": "dataset_groups", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "dataset_groups_deleted_at_idx": { - "name": "dataset_groups_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_groups_organization_id_idx": { - "name": "dataset_groups_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "dataset_groups_organization_id_fkey": { - "name": "dataset_groups_organization_id_fkey", - "tableFrom": "dataset_groups", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": { - "dataset_groups_policy": { - "name": "dataset_groups_policy", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "true" - } - }, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dataset_groups_permissions": { - "name": "dataset_groups_permissions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "dataset_group_id": { - "name": "dataset_group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "permission_id": { - "name": "permission_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "permission_type": { - "name": "permission_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "dataset_groups_permissions_dataset_group_id_idx": { - "name": "dataset_groups_permissions_dataset_group_id_idx", - "columns": [ - { - "expression": "dataset_group_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_groups_permissions_organization_id_idx": { - "name": "dataset_groups_permissions_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_groups_permissions_permission_id_idx": { - "name": "dataset_groups_permissions_permission_id_idx", - "columns": [ - { - "expression": "permission_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "dataset_groups_permissions_dataset_group_id_fkey": { - "name": "dataset_groups_permissions_dataset_group_id_fkey", - "tableFrom": "dataset_groups_permissions", - "columnsFrom": [ - "dataset_group_id" - ], - "tableTo": "dataset_groups", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "dataset_groups_permissions_organization_id_fkey": { - "name": "dataset_groups_permissions_organization_id_fkey", - "tableFrom": "dataset_groups_permissions", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "unique_dataset_group_permission": { - "name": "unique_dataset_group_permission", - "columns": [ - "dataset_group_id", - "permission_id", - "permission_type" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.dataset_permissions": { - "name": "dataset_permissions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dataset_id": { - "name": "dataset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "permission_id": { - "name": "permission_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "permission_type": { - "name": "permission_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "dataset_permissions_dataset_id_idx": { - "name": "dataset_permissions_dataset_id_idx", - "columns": [ - { - "expression": "dataset_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_permissions_deleted_at_idx": { - "name": "dataset_permissions_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_permissions_organization_id_idx": { - "name": "dataset_permissions_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "dataset_permissions_permission_lookup_idx": { - "name": "dataset_permissions_permission_lookup_idx", - "columns": [ - { - "expression": "permission_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - }, - { - "expression": "permission_type", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "dataset_permissions_organization_id_fkey": { - "name": "dataset_permissions_organization_id_fkey", - "tableFrom": "dataset_permissions", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "dataset_permissions_dataset_id_fkey": { - "name": "dataset_permissions_dataset_id_fkey", - "tableFrom": "dataset_permissions", - "columnsFrom": [ - "dataset_id" - ], - "tableTo": "datasets", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "dataset_permissions_dataset_id_permission_id_permission_typ_key": { - "name": "dataset_permissions_dataset_id_permission_id_permission_typ_key", - "columns": [ - "dataset_id", - "permission_id", - "permission_type" - ], - "nullsNotDistinct": false - } - }, - "policies": { - "dataset_permissions_policy": { - "name": "dataset_permissions_policy", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "true" - } - }, - "checkConstraints": { - "dataset_permissions_permission_type_check": { - "name": "dataset_permissions_permission_type_check", - "value": "(permission_type)::text = ANY ((ARRAY['user'::character varying, 'dataset_group'::character varying, 'permission_group'::character varying])::text[])" - } - }, - "isRLSEnabled": false - }, - "public.datasets": { - "name": "datasets", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "database_name": { - "name": "database_name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "when_to_use": { - "name": "when_to_use", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "when_not_to_use": { - "name": "when_not_to_use", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "dataset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "definition": { - "name": "definition", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "schema": { - "name": "schema", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "imported": { - "name": "imported", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "data_source_id": { - "name": "data_source_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "yml_file": { - "name": "yml_file", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "database_identifier": { - "name": "database_identifier", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "datasets_data_source_id_fkey": { - "name": "datasets_data_source_id_fkey", - "tableFrom": "datasets", - "columnsFrom": [ - "data_source_id" - ], - "tableTo": "data_sources", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "datasets_organization_id_fkey": { - "name": "datasets_organization_id_fkey", - "tableFrom": "datasets", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "datasets_created_by_fkey": { - "name": "datasets_created_by_fkey", - "tableFrom": "datasets", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "datasets_updated_by_fkey": { - "name": "datasets_updated_by_fkey", - "tableFrom": "datasets", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "datasets_name_schema_database_identifier_data_source_id_key": { - "name": "datasets_name_schema_database_identifier_data_source_id_key", - "columns": [ - "name", - "schema", - "database_identifier", - "data_source_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.datasets_to_dataset_groups": { - "name": "datasets_to_dataset_groups", - "schema": "", - "columns": { - "dataset_id": { - "name": "dataset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dataset_group_id": { - "name": "dataset_group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "datasets_to_dataset_groups_dataset_group_id_idx": { - "name": "datasets_to_dataset_groups_dataset_group_id_idx", - "columns": [ - { - "expression": "dataset_group_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "datasets_to_dataset_groups_dataset_id_fkey": { - "name": "datasets_to_dataset_groups_dataset_id_fkey", - "tableFrom": "datasets_to_dataset_groups", - "columnsFrom": [ - "dataset_id" - ], - "tableTo": "datasets", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "datasets_to_dataset_groups_dataset_group_id_fkey": { - "name": "datasets_to_dataset_groups_dataset_group_id_fkey", - "tableFrom": "datasets_to_dataset_groups", - "columnsFrom": [ - "dataset_group_id" - ], - "tableTo": "dataset_groups", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "datasets_to_dataset_groups_pkey": { - "name": "datasets_to_dataset_groups_pkey", - "columns": [ - "dataset_id", - "dataset_group_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": { - "datasets_to_dataset_groups_policy": { - "name": "datasets_to_dataset_groups_policy", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "true" - } - }, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.datasets_to_permission_groups": { - "name": "datasets_to_permission_groups", - "schema": "", - "columns": { - "dataset_id": { - "name": "dataset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "permission_group_id": { - "name": "permission_group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "datasets_to_permission_groups_dataset_id_fkey": { - "name": "datasets_to_permission_groups_dataset_id_fkey", - "tableFrom": "datasets_to_permission_groups", - "columnsFrom": [ - "dataset_id" - ], - "tableTo": "datasets", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "datasets_to_permission_groups_permission_group_id_fkey": { - "name": "datasets_to_permission_groups_permission_group_id_fkey", - "tableFrom": "datasets_to_permission_groups", - "columnsFrom": [ - "permission_group_id" - ], - "tableTo": "permission_groups", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "datasets_to_permission_groups_pkey": { - "name": "datasets_to_permission_groups_pkey", - "columns": [ - "dataset_id", - "permission_group_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": { - "datasets_to_permission_groups_policy": { - "name": "datasets_to_permission_groups_policy", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "true" - } - }, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.docs": { - "name": "docs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "docs_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'normal'" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "docs_organization_id_fkey": { - "name": "docs_organization_id_fkey", - "tableFrom": "docs", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "docs_name_organization_id_key": { - "name": "docs_name_organization_id_key", - "columns": [ - "name", - "organization_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.github_integrations": { - "name": "github_integrations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "installation_id": { - "name": "installation_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "app_id": { - "name": "app_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "github_org_id": { - "name": "github_org_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "github_org_name": { - "name": "github_org_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "token_vault_key": { - "name": "token_vault_key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "webhook_secret_vault_key": { - "name": "webhook_secret_vault_key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "repository_permissions": { - "name": "repository_permissions", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "status": { - "name": "status", - "type": "github_integration_status_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "installed_at": { - "name": "installed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_used_at": { - "name": "last_used_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_github_integrations_org_id": { - "name": "idx_github_integrations_org_id", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_github_integrations_installation_id": { - "name": "idx_github_integrations_installation_id", - "columns": [ - { - "expression": "installation_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_github_integrations_github_org_id": { - "name": "idx_github_integrations_github_org_id", - "columns": [ - { - "expression": "github_org_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "github_integrations_organization_id_fkey": { - "name": "github_integrations_organization_id_fkey", - "tableFrom": "github_integrations", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "github_integrations_user_id_fkey": { - "name": "github_integrations_user_id_fkey", - "tableFrom": "github_integrations", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "github_integrations_token_vault_key_unique": { - "name": "github_integrations_token_vault_key_unique", - "columns": [ - "token_vault_key" - ], - "nullsNotDistinct": false - }, - "github_integrations_org_installation_key": { - "name": "github_integrations_org_installation_key", - "columns": [ - "organization_id", - "installation_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.logs_write_back_configs": { - "name": "logs_write_back_configs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "data_source_id": { - "name": "data_source_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "database": { - "name": "database", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "schema": { - "name": "schema", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "table_name": { - "name": "table_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true, - "default": "'buster_query_logs'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "logs_write_back_configs_org_unique": { - "name": "logs_write_back_configs_org_unique", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"logs_write_back_configs\".\"deleted_at\" IS NULL", - "concurrently": false - }, - "idx_logs_write_back_configs_org_id": { - "name": "idx_logs_write_back_configs_org_id", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_logs_write_back_configs_data_source_id": { - "name": "idx_logs_write_back_configs_data_source_id", - "columns": [ - { - "expression": "data_source_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_logs_write_back_configs_deleted_at": { - "name": "idx_logs_write_back_configs_deleted_at", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "logs_write_back_configs_organization_id_fkey": { - "name": "logs_write_back_configs_organization_id_fkey", - "tableFrom": "logs_write_back_configs", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "logs_write_back_configs_data_source_id_fkey": { - "name": "logs_write_back_configs_data_source_id_fkey", - "tableFrom": "logs_write_back_configs", - "columnsFrom": [ - "data_source_id" - ], - "tableTo": "data_sources", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "request_message": { - "name": "request_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "response_messages": { - "name": "response_messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "message_analysis_mode": { - "name": "message_analysis_mode", - "type": "message_analysis_mode_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'auto'" - }, - "reasoning": { - "name": "reasoning", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "raw_llm_messages": { - "name": "raw_llm_messages", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - }, - "final_reasoning_message": { - "name": "final_reasoning_message", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "chat_id": { - "name": "chat_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "feedback": { - "name": "feedback", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "is_completed": { - "name": "is_completed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "post_processing_message": { - "name": "post_processing_message", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "trigger_run_id": { - "name": "trigger_run_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "metadata": { - "name": "metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - } - }, - "indexes": { - "messages_chat_id_idx": { - "name": "messages_chat_id_idx", - "columns": [ - { - "expression": "chat_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_created_at_idx": { - "name": "messages_created_at_idx", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_created_by_idx": { - "name": "messages_created_by_idx", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_deleted_at_idx": { - "name": "messages_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_raw_llm_messages_gin_idx": { - "name": "messages_raw_llm_messages_gin_idx", - "columns": [ - { - "expression": "raw_llm_messages", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "messages_response_messages_gin_idx": { - "name": "messages_response_messages_gin_idx", - "columns": [ - { - "expression": "response_messages", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "messages_reasoning_gin_idx": { - "name": "messages_reasoning_gin_idx", - "columns": [ - { - "expression": "reasoning", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "messages_id_deleted_at_idx": { - "name": "messages_id_deleted_at_idx", - "columns": [ - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - }, - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "messages_chat_id_fkey": { - "name": "messages_chat_id_fkey", - "tableFrom": "messages", - "columnsFrom": [ - "chat_id" - ], - "tableTo": "chats", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "messages_created_by_fkey": { - "name": "messages_created_by_fkey", - "tableFrom": "messages", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages_to_files": { - "name": "messages_to_files", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "file_id": { - "name": "file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "is_duplicate": { - "name": "is_duplicate", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "version_number": { - "name": "version_number", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 1 - } - }, - "indexes": { - "messages_files_file_id_idx": { - "name": "messages_files_file_id_idx", - "columns": [ - { - "expression": "file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_files_message_id_idx": { - "name": "messages_files_message_id_idx", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_mtf_active_by_file": { - "name": "idx_mtf_active_by_file", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"messages_to_files\".\"deleted_at\" is null", - "concurrently": false - } - }, - "foreignKeys": { - "messages_to_files_message_id_fkey": { - "name": "messages_to_files_message_id_fkey", - "tableFrom": "messages_to_files", - "columnsFrom": [ - "message_id" - ], - "tableTo": "messages", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "messages_to_files_message_id_file_id_key": { - "name": "messages_to_files_message_id_file_id_key", - "columns": [ - "message_id", - "file_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages_to_slack_messages": { - "name": "messages_to_slack_messages", - "schema": "", - "columns": { - "message_id": { - "name": "message_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "slack_message_id": { - "name": "slack_message_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "messages_to_slack_messages_message_id_idx": { - "name": "messages_to_slack_messages_message_id_idx", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "messages_to_slack_messages_slack_message_id_idx": { - "name": "messages_to_slack_messages_slack_message_id_idx", - "columns": [ - { - "expression": "slack_message_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "messages_to_slack_messages_message_id_fkey": { - "name": "messages_to_slack_messages_message_id_fkey", - "tableFrom": "messages_to_slack_messages", - "columnsFrom": [ - "message_id" - ], - "tableTo": "messages", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "messages_to_slack_messages_slack_message_id_fkey": { - "name": "messages_to_slack_messages_slack_message_id_fkey", - "tableFrom": "messages_to_slack_messages", - "columnsFrom": [ - "slack_message_id" - ], - "tableTo": "slack_message_tracking", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "messages_to_slack_messages_pkey": { - "name": "messages_to_slack_messages_pkey", - "columns": [ - "message_id", - "slack_message_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.metric_files": { - "name": "metric_files", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "file_name": { - "name": "file_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "jsonb", - "primaryKey": false, - "notNull": true - }, - "verification": { - "name": "verification", - "type": "verification_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'notRequested'" - }, - "evaluation_obj": { - "name": "evaluation_obj", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "evaluation_summary": { - "name": "evaluation_summary", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "evaluation_score": { - "name": "evaluation_score", - "type": "double precision", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publicly_accessible": { - "name": "publicly_accessible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "publicly_enabled_by": { - "name": "publicly_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "public_expiry_date": { - "name": "public_expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "version_history": { - "name": "version_history", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "data_metadata": { - "name": "data_metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "public_password": { - "name": "public_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "data_source_id": { - "name": "data_source_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "workspace_sharing": { - "name": "workspace_sharing", - "type": "workspace_sharing_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "workspace_sharing_enabled_by": { - "name": "workspace_sharing_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing_enabled_at": { - "name": "workspace_sharing_enabled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "saved_to_library": { - "name": "saved_to_library", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "metric_files_created_by_idx": { - "name": "metric_files_created_by_idx", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_data_metadata_idx": { - "name": "metric_files_data_metadata_idx", - "columns": [ - { - "expression": "data_metadata", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "jsonb_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "gin", - "concurrently": false - }, - "metric_files_deleted_at_idx": { - "name": "metric_files_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_organization_id_idx": { - "name": "metric_files_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "metric_files_created_by_fkey": { - "name": "metric_files_created_by_fkey", - "tableFrom": "metric_files", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "metric_files_publicly_enabled_by_fkey": { - "name": "metric_files_publicly_enabled_by_fkey", - "tableFrom": "metric_files", - "columnsFrom": [ - "publicly_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "fk_data_source": { - "name": "fk_data_source", - "tableFrom": "metric_files", - "columnsFrom": [ - "data_source_id" - ], - "tableTo": "data_sources", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "metric_files_workspace_sharing_enabled_by_fkey": { - "name": "metric_files_workspace_sharing_enabled_by_fkey", - "tableFrom": "metric_files", - "columnsFrom": [ - "workspace_sharing_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.metric_files_to_dashboard_files": { - "name": "metric_files_to_dashboard_files", - "schema": "", - "columns": { - "metric_file_id": { - "name": "metric_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dashboard_file_id": { - "name": "dashboard_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "metric_files_to_dashboard_files_dashboard_id_idx": { - "name": "metric_files_to_dashboard_files_dashboard_id_idx", - "columns": [ - { - "expression": "dashboard_file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_to_dashboard_files_deleted_at_idx": { - "name": "metric_files_to_dashboard_files_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_to_dashboard_files_metric_id_idx": { - "name": "metric_files_to_dashboard_files_metric_id_idx", - "columns": [ - { - "expression": "metric_file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "metric_files_to_dashboard_files_metric_file_id_fkey": { - "name": "metric_files_to_dashboard_files_metric_file_id_fkey", - "tableFrom": "metric_files_to_dashboard_files", - "columnsFrom": [ - "metric_file_id" - ], - "tableTo": "metric_files", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "metric_files_to_dashboard_files_dashboard_file_id_fkey": { - "name": "metric_files_to_dashboard_files_dashboard_file_id_fkey", - "tableFrom": "metric_files_to_dashboard_files", - "columnsFrom": [ - "dashboard_file_id" - ], - "tableTo": "dashboard_files", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "metric_files_to_dashboard_files_created_by_fkey": { - "name": "metric_files_to_dashboard_files_created_by_fkey", - "tableFrom": "metric_files_to_dashboard_files", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "metric_files_to_dashboard_files_pkey": { - "name": "metric_files_to_dashboard_files_pkey", - "columns": [ - "metric_file_id", - "dashboard_file_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.metric_files_to_datasets": { - "name": "metric_files_to_datasets", - "schema": "", - "columns": { - "metric_file_id": { - "name": "metric_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "dataset_id": { - "name": "dataset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "metric_version_number": { - "name": "metric_version_number", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": { - "fk_metric_file": { - "name": "fk_metric_file", - "tableFrom": "metric_files_to_datasets", - "columnsFrom": [ - "metric_file_id" - ], - "tableTo": "metric_files", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "fk_dataset": { - "name": "fk_dataset", - "tableFrom": "metric_files_to_datasets", - "columnsFrom": [ - "dataset_id" - ], - "tableTo": "datasets", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "metric_files_to_datasets_pkey": { - "name": "metric_files_to_datasets_pkey", - "columns": [ - "metric_file_id", - "dataset_id", - "metric_version_number" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.metric_files_to_report_files": { - "name": "metric_files_to_report_files", - "schema": "", - "columns": { - "metric_file_id": { - "name": "metric_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "report_file_id": { - "name": "report_file_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "metric_files_to_report_files_report_id_idx": { - "name": "metric_files_to_report_files_report_id_idx", - "columns": [ - { - "expression": "report_file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_to_report_files_deleted_at_idx": { - "name": "metric_files_to_report_files_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "metric_files_to_report_files_metric_id_idx": { - "name": "metric_files_to_report_files_metric_id_idx", - "columns": [ - { - "expression": "metric_file_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "metric_files_to_report_files_metric_file_id_fkey": { - "name": "metric_files_to_report_files_metric_file_id_fkey", - "tableFrom": "metric_files_to_report_files", - "columnsFrom": [ - "metric_file_id" - ], - "tableTo": "metric_files", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "metric_files_to_report_files_report_file_id_fkey": { - "name": "metric_files_to_report_files_report_file_id_fkey", - "tableFrom": "metric_files_to_report_files", - "columnsFrom": [ - "report_file_id" - ], - "tableTo": "report_files", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - }, - "metric_files_to_report_files_created_by_fkey": { - "name": "metric_files_to_report_files_created_by_fkey", - "tableFrom": "metric_files_to_report_files", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "metric_files_to_report_files_pkey": { - "name": "metric_files_to_report_files_pkey", - "columns": [ - "metric_file_id", - "report_file_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.organizations": { - "name": "organizations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "domain": { - "name": "domain", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "payment_required": { - "name": "payment_required", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "domains": { - "name": "domains", - "type": "text[]", - "primaryKey": false, - "notNull": false - }, - "restrict_new_user_invitations": { - "name": "restrict_new_user_invitations", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "default_role": { - "name": "default_role", - "type": "user_organization_role_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'restricted_querier'" - }, - "organization_color_palettes": { - "name": "organization_color_palettes", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\"selectedId\": null, \"palettes\": [], \"selectedDictionaryPalette\": null}'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "organizations_name_key": { - "name": "organizations_name_key", - "columns": [ - "name" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permission_groups": { - "name": "permission_groups", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "permission_groups_organization_id_fkey": { - "name": "permission_groups_organization_id_fkey", - "tableFrom": "permission_groups", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "permission_groups_created_by_fkey": { - "name": "permission_groups_created_by_fkey", - "tableFrom": "permission_groups", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "permission_groups_updated_by_fkey": { - "name": "permission_groups_updated_by_fkey", - "tableFrom": "permission_groups", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permission_groups_to_identities": { - "name": "permission_groups_to_identities", - "schema": "", - "columns": { - "permission_group_id": { - "name": "permission_group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "identity_id": { - "name": "identity_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "identity_type": { - "name": "identity_type", - "type": "identity_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "permission_groups_to_identities_created_by_fkey": { - "name": "permission_groups_to_identities_created_by_fkey", - "tableFrom": "permission_groups_to_identities", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "permission_groups_to_identities_updated_by_fkey": { - "name": "permission_groups_to_identities_updated_by_fkey", - "tableFrom": "permission_groups_to_identities", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "permission_groups_to_identities_pkey": { - "name": "permission_groups_to_identities_pkey", - "columns": [ - "permission_group_id", - "identity_id", - "identity_type" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.permission_groups_to_users": { - "name": "permission_groups_to_users", - "schema": "", - "columns": { - "permission_group_id": { - "name": "permission_group_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "permission_groups_to_users_user_id_idx": { - "name": "permission_groups_to_users_user_id_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "permission_groups_to_users_permission_group_id_fkey": { - "name": "permission_groups_to_users_permission_group_id_fkey", - "tableFrom": "permission_groups_to_users", - "columnsFrom": [ - "permission_group_id" - ], - "tableTo": "permission_groups", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "permission_groups_to_users_user_id_fkey": { - "name": "permission_groups_to_users_user_id_fkey", - "tableFrom": "permission_groups_to_users", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "permission_groups_to_users_pkey": { - "name": "permission_groups_to_users_pkey", - "columns": [ - "permission_group_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": { - "permission_groups_to_users_policy": { - "name": "permission_groups_to_users_policy", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "true" - } - }, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.report_files": { - "name": "report_files", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "CURRENT_TIMESTAMP" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "publicly_accessible": { - "name": "publicly_accessible", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "publicly_enabled_by": { - "name": "publicly_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "public_expiry_date": { - "name": "public_expiry_date", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "version_history": { - "name": "version_history", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "public_password": { - "name": "public_password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing": { - "name": "workspace_sharing", - "type": "workspace_sharing_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "workspace_sharing_enabled_by": { - "name": "workspace_sharing_enabled_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "workspace_sharing_enabled_at": { - "name": "workspace_sharing_enabled_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "screenshot_bucket_key": { - "name": "screenshot_bucket_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "saved_to_library": { - "name": "saved_to_library", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": { - "report_files_created_by_idx": { - "name": "report_files_created_by_idx", - "columns": [ - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "report_files_deleted_at_idx": { - "name": "report_files_deleted_at_idx", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "report_files_organization_id_idx": { - "name": "report_files_organization_id_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "report_files_created_by_fkey": { - "name": "report_files_created_by_fkey", - "tableFrom": "report_files", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "report_files_publicly_enabled_by_fkey": { - "name": "report_files_publicly_enabled_by_fkey", - "tableFrom": "report_files", - "columnsFrom": [ - "publicly_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "report_files_workspace_sharing_enabled_by_fkey": { - "name": "report_files_workspace_sharing_enabled_by_fkey", - "tableFrom": "report_files", - "columnsFrom": [ - "workspace_sharing_enabled_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "report_files_organization_id_fkey": { - "name": "report_files_organization_id_fkey", - "tableFrom": "report_files", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.s3_integrations": { - "name": "s3_integrations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "provider": { - "name": "provider", - "type": "storage_provider_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_s3_integrations_organization_id": { - "name": "idx_s3_integrations_organization_id", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_s3_integrations_deleted_at": { - "name": "idx_s3_integrations_deleted_at", - "columns": [ - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "s3_integrations_organization_id_fkey": { - "name": "s3_integrations_organization_id_fkey", - "tableFrom": "s3_integrations", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.shortcuts": { - "name": "shortcuts", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "instructions": { - "name": "instructions", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "share_with_workspace": { - "name": "share_with_workspace", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "shortcuts_org_user_idx": { - "name": "shortcuts_org_user_idx", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - }, - { - "expression": "created_by", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "shortcuts_name_idx": { - "name": "shortcuts_name_idx", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "shortcuts_workspace_unique": { - "name": "shortcuts_workspace_unique", - "columns": [ - { - "expression": "name", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": true, - "with": {}, - "method": "btree", - "where": "\"shortcuts\".\"share_with_workspace\" = true", - "concurrently": false - } - }, - "foreignKeys": { - "shortcuts_created_by_fkey": { - "name": "shortcuts_created_by_fkey", - "tableFrom": "shortcuts", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "shortcuts_updated_by_fkey": { - "name": "shortcuts_updated_by_fkey", - "tableFrom": "shortcuts", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "shortcuts_organization_id_fkey": { - "name": "shortcuts_organization_id_fkey", - "tableFrom": "shortcuts", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "shortcuts_personal_unique": { - "name": "shortcuts_personal_unique", - "columns": [ - "name", - "organization_id", - "created_by" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.slack_integrations": { - "name": "slack_integrations", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "oauth_state": { - "name": "oauth_state", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "oauth_expires_at": { - "name": "oauth_expires_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "oauth_metadata": { - "name": "oauth_metadata", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "team_id": { - "name": "team_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "team_name": { - "name": "team_name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "team_domain": { - "name": "team_domain", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "enterprise_id": { - "name": "enterprise_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "bot_user_id": { - "name": "bot_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "token_vault_key": { - "name": "token_vault_key", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "installed_by_slack_user_id": { - "name": "installed_by_slack_user_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "installed_at": { - "name": "installed_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "last_used_at": { - "name": "last_used_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "slack_integration_status_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "default_channel": { - "name": "default_channel", - "type": "jsonb", - "primaryKey": false, - "notNull": false, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "default_sharing_permissions": { - "name": "default_sharing_permissions", - "type": "slack_sharing_permission_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'shareWithChannel'" - } - }, - "indexes": { - "idx_slack_integrations_org_id": { - "name": "idx_slack_integrations_org_id", - "columns": [ - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_slack_integrations_team_id": { - "name": "idx_slack_integrations_team_id", - "columns": [ - { - "expression": "team_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_slack_integrations_oauth_state": { - "name": "idx_slack_integrations_oauth_state", - "columns": [ - { - "expression": "oauth_state", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_slack_integrations_oauth_expires": { - "name": "idx_slack_integrations_oauth_expires", - "columns": [ - { - "expression": "oauth_expires_at", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "timestamptz_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "slack_integrations_organization_id_fkey": { - "name": "slack_integrations_organization_id_fkey", - "tableFrom": "slack_integrations", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "slack_integrations_user_id_fkey": { - "name": "slack_integrations_user_id_fkey", - "tableFrom": "slack_integrations", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "slack_integrations_oauth_state_unique": { - "name": "slack_integrations_oauth_state_unique", - "columns": [ - "oauth_state" - ], - "nullsNotDistinct": false - }, - "slack_integrations_token_vault_key_unique": { - "name": "slack_integrations_token_vault_key_unique", - "columns": [ - "token_vault_key" - ], - "nullsNotDistinct": false - }, - "slack_integrations_org_team_key": { - "name": "slack_integrations_org_team_key", - "columns": [ - "organization_id", - "team_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": { - "slack_integrations_status_check": { - "name": "slack_integrations_status_check", - "value": "(status = 'pending' AND oauth_state IS NOT NULL) OR (status != 'pending' AND team_id IS NOT NULL)" - } - }, - "isRLSEnabled": false - }, - "public.slack_message_tracking": { - "name": "slack_message_tracking", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "integration_id": { - "name": "integration_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "internal_message_id": { - "name": "internal_message_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "slack_channel_id": { - "name": "slack_channel_id", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slack_message_ts": { - "name": "slack_message_ts", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "slack_thread_ts": { - "name": "slack_thread_ts", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "message_type": { - "name": "message_type", - "type": "varchar(50)", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sender_info": { - "name": "sender_info", - "type": "jsonb", - "primaryKey": false, - "notNull": false - }, - "sent_at": { - "name": "sent_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "idx_message_tracking_integration": { - "name": "idx_message_tracking_integration", - "columns": [ - { - "expression": "integration_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "uuid_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_message_tracking_channel": { - "name": "idx_message_tracking_channel", - "columns": [ - { - "expression": "slack_channel_id", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "idx_message_tracking_thread": { - "name": "idx_message_tracking_thread", - "columns": [ - { - "expression": "slack_thread_ts", - "isExpression": false, - "asc": true, - "nulls": "last", - "opclass": "text_ops" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "slack_message_tracking_integration_id_fkey": { - "name": "slack_message_tracking_integration_id_fkey", - "tableFrom": "slack_message_tracking", - "columnsFrom": [ - "integration_id" - ], - "tableTo": "slack_integrations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "slack_message_tracking_internal_message_id_unique": { - "name": "slack_message_tracking_internal_message_id_unique", - "columns": [ - "internal_message_id" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams": { - "name": "teams", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "sharing_setting": { - "name": "sharing_setting", - "type": "sharing_setting_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "edit_sql": { - "name": "edit_sql", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "upload_csv": { - "name": "upload_csv", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "export_assets": { - "name": "export_assets", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_slack_enabled": { - "name": "email_slack_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "teams_organization_id_fkey": { - "name": "teams_organization_id_fkey", - "tableFrom": "teams", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "teams_created_by_fkey": { - "name": "teams_created_by_fkey", - "tableFrom": "teams", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "teams_name_key": { - "name": "teams_name_key", - "columns": [ - "name" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.teams_to_users": { - "name": "teams_to_users", - "schema": "", - "columns": { - "team_id": { - "name": "team_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "team_role_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'member'" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "teams_to_users_team_id_fkey": { - "name": "teams_to_users_team_id_fkey", - "tableFrom": "teams_to_users", - "columnsFrom": [ - "team_id" - ], - "tableTo": "teams", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "teams_to_users_user_id_fkey": { - "name": "teams_to_users_user_id_fkey", - "tableFrom": "teams_to_users", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "teams_to_users_pkey": { - "name": "teams_to_users_pkey", - "columns": [ - "team_id", - "user_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user_favorites": { - "name": "user_favorites", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_id": { - "name": "asset_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "asset_type": { - "name": "asset_type", - "type": "asset_type_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "order_index": { - "name": "order_index", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_favorites_user_id_fkey": { - "name": "user_favorites_user_id_fkey", - "tableFrom": "user_favorites", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "user_favorites_pkey": { - "name": "user_favorites_pkey", - "columns": [ - "user_id", - "asset_id", - "asset_type" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users": { - "name": "users", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true, - "default": "gen_random_uuid()" - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "config": { - "name": "config", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "attributes": { - "name": "attributes", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "suggested_prompts": { - "name": "suggested_prompts", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{\n \"suggestedPrompts\": {\n \"report\": [\n \"provide a trend analysis of quarterly profits\",\n \"evaluate product performance across regions\"\n ],\n \"dashboard\": [\n \"create a sales performance dashboard\",\n \"design a revenue forecast dashboard\"\n ],\n \"visualization\": [\n \"create a metric for monthly sales\",\n \"show top vendors by purchase volume\"\n ],\n \"help\": [\n \"what types of analyses can you perform?\",\n \"what questions can I ask buster?\",\n \"what data models are available for queries?\",\n \"can you explain your forecasting capabilities?\"\n ]\n },\n \"updatedAt\": \"2024-01-01T00:00:00.000Z\"\n }'::jsonb" - }, - "personalization_enabled": { - "name": "personalization_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "personalization_config": { - "name": "personalization_config", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'{}'::jsonb" - }, - "last_used_shortcuts": { - "name": "last_used_shortcuts", - "type": "jsonb", - "primaryKey": false, - "notNull": true, - "default": "'[]'::jsonb" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "users_email_key": { - "name": "users_email_key", - "columns": [ - "email" - ], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.users_to_organizations": { - "name": "users_to_organizations", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "organization_id": { - "name": "organization_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "role": { - "name": "role", - "type": "user_organization_role_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'querier'" - }, - "sharing_setting": { - "name": "sharing_setting", - "type": "sharing_setting_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "edit_sql": { - "name": "edit_sql", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "upload_csv": { - "name": "upload_csv", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "export_assets": { - "name": "export_assets", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "email_slack_enabled": { - "name": "email_slack_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "deleted_at": { - "name": "deleted_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, - "created_by": { - "name": "created_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "updated_by": { - "name": "updated_by", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "deleted_by": { - "name": "deleted_by", - "type": "uuid", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "user_organization_status_enum", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'active'" - } - }, - "indexes": { - "idx_uto_active_by_user": { - "name": "idx_uto_active_by_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "organization_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "where": "\"users_to_organizations\".\"deleted_at\" is null", - "concurrently": false - } - }, - "foreignKeys": { - "users_to_organizations_organization_id_fkey": { - "name": "users_to_organizations_organization_id_fkey", - "tableFrom": "users_to_organizations", - "columnsFrom": [ - "organization_id" - ], - "tableTo": "organizations", - "columnsTo": [ - "id" - ], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "users_to_organizations_user_id_fkey": { - "name": "users_to_organizations_user_id_fkey", - "tableFrom": "users_to_organizations", - "columnsFrom": [ - "user_id" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "users_to_organizations_created_by_fkey": { - "name": "users_to_organizations_created_by_fkey", - "tableFrom": "users_to_organizations", - "columnsFrom": [ - "created_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "users_to_organizations_updated_by_fkey": { - "name": "users_to_organizations_updated_by_fkey", - "tableFrom": "users_to_organizations", - "columnsFrom": [ - "updated_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - }, - "users_to_organizations_deleted_by_fkey": { - "name": "users_to_organizations_deleted_by_fkey", - "tableFrom": "users_to_organizations", - "columnsFrom": [ - "deleted_by" - ], - "tableTo": "users", - "columnsTo": [ - "id" - ], - "onUpdate": "cascade", - "onDelete": "no action" - } - }, - "compositePrimaryKeys": { - "users_to_organizations_pkey": { - "name": "users_to_organizations_pkey", - "columns": [ - "user_id", - "organization_id" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.asset_permission_role_enum": { - "name": "asset_permission_role_enum", - "schema": "public", - "values": [ - "owner", - "viewer", - "can_view", - "can_filter", - "can_edit", - "full_access" - ] - }, - "public.asset_type_enum": { - "name": "asset_type_enum", - "schema": "public", - "values": [ - "chat", - "metric_file", - "dashboard_file", - "report_file", - "collection" - ] - }, - "public.data_source_onboarding_status_enum": { - "name": "data_source_onboarding_status_enum", - "schema": "public", - "values": [ - "notStarted", - "inProgress", - "completed", - "failed" - ] - }, - "public.dataset_type_enum": { - "name": "dataset_type_enum", - "schema": "public", - "values": [ - "table", - "view", - "materializedView" - ] - }, - "public.docs_type_enum": { - "name": "docs_type_enum", - "schema": "public", - "values": [ - "analyst", - "normal" - ] - }, - "public.github_integration_status_enum": { - "name": "github_integration_status_enum", - "schema": "public", - "values": [ - "pending", - "active", - "suspended", - "revoked" - ] - }, - "public.identity_type_enum": { - "name": "identity_type_enum", - "schema": "public", - "values": [ - "user", - "team", - "organization" - ] - }, - "public.message_analysis_mode_enum": { - "name": "message_analysis_mode_enum", - "schema": "public", - "values": [ - "auto", - "standard", - "investigation" - ] - }, - "public.message_feedback_enum": { - "name": "message_feedback_enum", - "schema": "public", - "values": [ - "positive", - "negative" - ] - }, - "public.sharing_setting_enum": { - "name": "sharing_setting_enum", - "schema": "public", - "values": [ - "none", - "team", - "organization", - "public" - ] - }, - "public.slack_chat_authorization_enum": { - "name": "slack_chat_authorization_enum", - "schema": "public", - "values": [ - "unauthorized", - "authorized", - "auto_added" - ] - }, - "public.slack_integration_status_enum": { - "name": "slack_integration_status_enum", - "schema": "public", - "values": [ - "pending", - "active", - "failed", - "revoked" - ] - }, - "public.slack_sharing_permission_enum": { - "name": "slack_sharing_permission_enum", - "schema": "public", - "values": [ - "shareWithWorkspace", - "shareWithChannel", - "noSharing" - ] - }, - "public.storage_provider_enum": { - "name": "storage_provider_enum", - "schema": "public", - "values": [ - "s3", - "r2", - "gcs" - ] - }, - "public.stored_values_status_enum": { - "name": "stored_values_status_enum", - "schema": "public", - "values": [ - "syncing", - "success", - "failed" - ] - }, - "public.table_type_enum": { - "name": "table_type_enum", - "schema": "public", - "values": [ - "TABLE", - "VIEW", - "MATERIALIZED_VIEW", - "EXTERNAL_TABLE", - "TEMPORARY_TABLE" - ] - }, - "public.team_role_enum": { - "name": "team_role_enum", - "schema": "public", - "values": [ - "manager", - "member", - "none" - ] - }, - "public.user_organization_role_enum": { - "name": "user_organization_role_enum", - "schema": "public", - "values": [ - "workspace_admin", - "data_admin", - "querier", - "restricted_querier", - "viewer" - ] - }, - "public.user_organization_status_enum": { - "name": "user_organization_status_enum", - "schema": "public", - "values": [ - "active", - "inactive", - "pending", - "guest" - ] - }, - "public.verification_enum": { - "name": "verification_enum", - "schema": "public", - "values": [ - "verified", - "backlogged", - "inReview", - "requested", - "notRequested" - ] - }, - "public.workspace_sharing_enum": { - "name": "workspace_sharing_enum", - "schema": "public", - "values": [ - "none", - "can_view", - "can_edit", - "full_access" - ] - } - }, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, "schemas": {}, - "tables": {} - } -} \ No newline at end of file + "views": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } + } \ No newline at end of file diff --git a/packages/database/drizzle/meta/0121_snapshot.json b/packages/database/drizzle/meta/0121_snapshot.json index eebde5500..1a197b8f7 100644 --- a/packages/database/drizzle/meta/0121_snapshot.json +++ b/packages/database/drizzle/meta/0121_snapshot.json @@ -1,6 +1,6 @@ { - "id": "2a797eeb-1401-4f33-830f-f3e4dde1fce8", - "prevId": "6ea1ae92-5440-4532-8f74-501949f53028", + "id": "6ea1ae92-5440-4532-8f74-501949f53028", + "prevId": "3c1cc154-d1f6-484b-8aa2-0ba661948d0e", "version": "7", "dialect": "postgresql", "tables": { @@ -59,38 +59,38 @@ "api_keys_organization_id_fkey": { "name": "api_keys_organization_id_fkey", "tableFrom": "api_keys", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "api_keys_owner_id_fkey": { "name": "api_keys_owner_id_fkey", "tableFrom": "api_keys", - "tableTo": "users", "columnsFrom": [ "owner_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "api_keys_key_key": { "name": "api_keys_key_key", - "nullsNotDistinct": false, "columns": [ "key" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -197,10 +197,10 @@ } ], "isUnique": false, - "where": "\"asset_permissions\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false }, "idx_perm_active_identity_asset": { "name": "idx_perm_active_identity_asset", @@ -231,38 +231,38 @@ } ], "isUnique": false, - "where": "\"asset_permissions\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false } }, "foreignKeys": { "asset_permissions_created_by_fkey": { "name": "asset_permissions_created_by_fkey", "tableFrom": "asset_permissions", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "asset_permissions_updated_by_fkey": { "name": "asset_permissions_updated_by_fkey", "tableFrom": "asset_permissions", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -357,9 +357,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "pgroonga_content_index": { "name": "pgroonga_content_index", @@ -373,9 +373,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "pgroonga", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -480,9 +480,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "pgroonga", - "with": {} + "concurrently": false }, "idx_as2_active_by_asset": { "name": "idx_as2_active_by_asset", @@ -501,10 +501,10 @@ } ], "isUnique": false, - "where": "\"asset_search_v2\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false }, "idx_as2_active_by_org": { "name": "idx_as2_active_by_org", @@ -517,49 +517,49 @@ } ], "isUnique": false, - "where": "\"asset_search_v2\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false } }, "foreignKeys": { "asset_search_v2_organization_id_fkey": { "name": "asset_search_v2_organization_id_fkey", "tableFrom": "asset_search_v2", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "asset_search_v2_created_by_fkey": { "name": "asset_search_v2_created_by_fkey", "tableFrom": "asset_search_v2", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "asset_search_v2_asset_type_asset_id_unique": { "name": "asset_search_v2_asset_type_asset_id_unique", - "nullsNotDistinct": false, "columns": [ "asset_id", "asset_type" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -710,12 +710,6 @@ "primaryKey": false, "notNull": false }, - "screenshot_taken_at": { - "name": "screenshot_taken_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, "saved_to_library": { "name": "saved_to_library", "type": "boolean", @@ -737,9 +731,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "chats_created_by_idx": { "name": "chats_created_by_idx", @@ -753,9 +747,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "chats_organization_id_idx": { "name": "chats_organization_id_idx", @@ -769,9 +763,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_chats_most_recent_file_id": { "name": "idx_chats_most_recent_file_id", @@ -785,9 +779,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_chats_most_recent_file_type": { "name": "idx_chats_most_recent_file_type", @@ -801,76 +795,76 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "chats_organization_id_fkey": { "name": "chats_organization_id_fkey", "tableFrom": "chats", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "chats_created_by_fkey": { "name": "chats_created_by_fkey", "tableFrom": "chats", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "chats_updated_by_fkey": { "name": "chats_updated_by_fkey", "tableFrom": "chats", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "chats_publicly_enabled_by_fkey": { "name": "chats_publicly_enabled_by_fkey", "tableFrom": "chats", - "tableTo": "users", "columnsFrom": [ "publicly_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "chats_workspace_sharing_enabled_by_fkey": { "name": "chats_workspace_sharing_enabled_by_fkey", "tableFrom": "chats", - "tableTo": "users", "columnsFrom": [ "workspace_sharing_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -965,12 +959,6 @@ "type": "text", "primaryKey": false, "notNull": false - }, - "screenshot_taken_at": { - "name": "screenshot_taken_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false } }, "indexes": {}, @@ -978,54 +966,54 @@ "collections_organization_id_fkey": { "name": "collections_organization_id_fkey", "tableFrom": "collections", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "collections_created_by_fkey": { "name": "collections_created_by_fkey", "tableFrom": "collections", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "collections_updated_by_fkey": { "name": "collections_updated_by_fkey", "tableFrom": "collections", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "collections_workspace_sharing_enabled_by_fkey": { "name": "collections_workspace_sharing_enabled_by_fkey", "tableFrom": "collections", - "tableTo": "users", "columnsFrom": [ "workspace_sharing_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -1114,38 +1102,38 @@ } ], "isUnique": false, - "where": "\"collections_to_assets\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"collections_to_assets\".\"deleted_at\" is null", + "concurrently": false } }, "foreignKeys": { "collections_to_assets_created_by_fkey": { "name": "collections_to_assets_created_by_fkey", "tableFrom": "collections_to_assets", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "collections_to_assets_updated_by_fkey": { "name": "collections_to_assets_updated_by_fkey", "tableFrom": "collections_to_assets", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -1289,12 +1277,6 @@ "primaryKey": false, "notNull": false }, - "screenshot_taken_at": { - "name": "screenshot_taken_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, "saved_to_library": { "name": "saved_to_library", "type": "boolean", @@ -1316,9 +1298,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dashboard_files_deleted_at_idx": { "name": "dashboard_files_deleted_at_idx", @@ -1332,9 +1314,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dashboard_files_organization_id_idx": { "name": "dashboard_files_organization_id_idx", @@ -1348,50 +1330,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "dashboard_files_created_by_fkey": { "name": "dashboard_files_created_by_fkey", "tableFrom": "dashboard_files", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "dashboard_files_publicly_enabled_by_fkey": { "name": "dashboard_files_publicly_enabled_by_fkey", "tableFrom": "dashboard_files", - "tableTo": "users", "columnsFrom": [ "publicly_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "dashboard_files_workspace_sharing_enabled_by_fkey": { "name": "dashboard_files_workspace_sharing_enabled_by_fkey", "tableFrom": "dashboard_files", - "tableTo": "users", "columnsFrom": [ "workspace_sharing_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -1494,53 +1476,53 @@ "data_sources_organization_id_fkey": { "name": "data_sources_organization_id_fkey", "tableFrom": "data_sources", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "data_sources_created_by_fkey": { "name": "data_sources_created_by_fkey", "tableFrom": "data_sources", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "data_sources_updated_by_fkey": { "name": "data_sources_updated_by_fkey", "tableFrom": "data_sources", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "data_sources_name_organization_id_env_key": { "name": "data_sources_name_organization_id_env_key", - "nullsNotDistinct": false, "columns": [ "name", "organization_id", "env" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -1604,9 +1586,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_groups_organization_id_idx": { "name": "dataset_groups_organization_id_idx", @@ -1620,24 +1602,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "dataset_groups_organization_id_fkey": { "name": "dataset_groups_organization_id_fkey", "tableFrom": "dataset_groups", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -1725,9 +1707,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_groups_permissions_organization_id_idx": { "name": "dataset_groups_permissions_organization_id_idx", @@ -1741,9 +1723,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_groups_permissions_permission_id_idx": { "name": "dataset_groups_permissions_permission_id_idx", @@ -1757,49 +1739,49 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "dataset_groups_permissions_dataset_group_id_fkey": { "name": "dataset_groups_permissions_dataset_group_id_fkey", "tableFrom": "dataset_groups_permissions", - "tableTo": "dataset_groups", "columnsFrom": [ "dataset_group_id" ], + "tableTo": "dataset_groups", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "dataset_groups_permissions_organization_id_fkey": { "name": "dataset_groups_permissions_organization_id_fkey", "tableFrom": "dataset_groups_permissions", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "unique_dataset_group_permission": { "name": "unique_dataset_group_permission", - "nullsNotDistinct": false, "columns": [ "dataset_group_id", "permission_id", "permission_type" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -1875,9 +1857,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_permissions_deleted_at_idx": { "name": "dataset_permissions_deleted_at_idx", @@ -1891,9 +1873,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_permissions_organization_id_idx": { "name": "dataset_permissions_organization_id_idx", @@ -1907,9 +1889,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "dataset_permissions_permission_lookup_idx": { "name": "dataset_permissions_permission_lookup_idx", @@ -1930,49 +1912,49 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "dataset_permissions_organization_id_fkey": { "name": "dataset_permissions_organization_id_fkey", "tableFrom": "dataset_permissions", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "dataset_permissions_dataset_id_fkey": { "name": "dataset_permissions_dataset_id_fkey", "tableFrom": "dataset_permissions", - "tableTo": "datasets", "columnsFrom": [ "dataset_id" ], + "tableTo": "datasets", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "dataset_permissions_dataset_id_permission_id_permission_typ_key": { "name": "dataset_permissions_dataset_id_permission_id_permission_typ_key", - "nullsNotDistinct": false, "columns": [ "dataset_id", "permission_id", "permission_type" - ] + ], + "nullsNotDistinct": false } }, "policies": { @@ -2130,67 +2112,67 @@ "datasets_data_source_id_fkey": { "name": "datasets_data_source_id_fkey", "tableFrom": "datasets", - "tableTo": "data_sources", "columnsFrom": [ "data_source_id" ], + "tableTo": "data_sources", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "datasets_organization_id_fkey": { "name": "datasets_organization_id_fkey", "tableFrom": "datasets", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "datasets_created_by_fkey": { "name": "datasets_created_by_fkey", "tableFrom": "datasets", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "datasets_updated_by_fkey": { "name": "datasets_updated_by_fkey", "tableFrom": "datasets", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "datasets_name_schema_database_identifier_data_source_id_key": { "name": "datasets_name_schema_database_identifier_data_source_id_key", - "nullsNotDistinct": false, "columns": [ "name", "schema", "database_identifier", "data_source_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -2247,37 +2229,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "datasets_to_dataset_groups_dataset_id_fkey": { "name": "datasets_to_dataset_groups_dataset_id_fkey", "tableFrom": "datasets_to_dataset_groups", - "tableTo": "datasets", "columnsFrom": [ "dataset_id" ], + "tableTo": "datasets", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "datasets_to_dataset_groups_dataset_group_id_fkey": { "name": "datasets_to_dataset_groups_dataset_group_id_fkey", "tableFrom": "datasets_to_dataset_groups", - "tableTo": "dataset_groups", "columnsFrom": [ "dataset_group_id" ], + "tableTo": "dataset_groups", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": { @@ -2346,28 +2328,28 @@ "datasets_to_permission_groups_dataset_id_fkey": { "name": "datasets_to_permission_groups_dataset_id_fkey", "tableFrom": "datasets_to_permission_groups", - "tableTo": "datasets", "columnsFrom": [ "dataset_id" ], + "tableTo": "datasets", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "datasets_to_permission_groups_permission_group_id_fkey": { "name": "datasets_to_permission_groups_permission_group_id_fkey", "tableFrom": "datasets_to_permission_groups", - "tableTo": "permission_groups", "columnsFrom": [ "permission_group_id" ], + "tableTo": "permission_groups", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": { @@ -2457,26 +2439,26 @@ "docs_organization_id_fkey": { "name": "docs_organization_id_fkey", "tableFrom": "docs", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "docs_name_organization_id_key": { "name": "docs_name_organization_id_key", - "nullsNotDistinct": false, "columns": [ "name", "organization_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -2603,9 +2585,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_github_integrations_installation_id": { "name": "idx_github_integrations_installation_id", @@ -2619,9 +2601,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_github_integrations_github_org_id": { "name": "idx_github_integrations_github_org_id", @@ -2635,55 +2617,55 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "github_integrations_organization_id_fkey": { "name": "github_integrations_organization_id_fkey", "tableFrom": "github_integrations", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "github_integrations_user_id_fkey": { "name": "github_integrations_user_id_fkey", "tableFrom": "github_integrations", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "github_integrations_token_vault_key_unique": { "name": "github_integrations_token_vault_key_unique", - "nullsNotDistinct": false, "columns": [ "token_vault_key" - ] + ], + "nullsNotDistinct": false }, "github_integrations_org_installation_key": { "name": "github_integrations_org_installation_key", - "nullsNotDistinct": false, "columns": [ "organization_id", "installation_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -2765,10 +2747,10 @@ } ], "isUnique": true, - "where": "\"logs_write_back_configs\".\"deleted_at\" IS NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"logs_write_back_configs\".\"deleted_at\" IS NULL", + "concurrently": false }, "idx_logs_write_back_configs_org_id": { "name": "idx_logs_write_back_configs_org_id", @@ -2782,9 +2764,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_logs_write_back_configs_data_source_id": { "name": "idx_logs_write_back_configs_data_source_id", @@ -2798,9 +2780,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_logs_write_back_configs_deleted_at": { "name": "idx_logs_write_back_configs_deleted_at", @@ -2813,37 +2795,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "logs_write_back_configs_organization_id_fkey": { "name": "logs_write_back_configs_organization_id_fkey", "tableFrom": "logs_write_back_configs", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "logs_write_back_configs_data_source_id_fkey": { "name": "logs_write_back_configs_data_source_id_fkey", "tableFrom": "logs_write_back_configs", - "tableTo": "data_sources", "columnsFrom": [ "data_source_id" ], + "tableTo": "data_sources", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -2988,9 +2970,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_created_at_idx": { "name": "messages_created_at_idx", @@ -3004,9 +2986,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_created_by_idx": { "name": "messages_created_by_idx", @@ -3020,9 +3002,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_deleted_at_idx": { "name": "messages_deleted_at_idx", @@ -3036,9 +3018,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_raw_llm_messages_gin_idx": { "name": "messages_raw_llm_messages_gin_idx", @@ -3052,9 +3034,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "gin", - "with": {} + "concurrently": false }, "messages_response_messages_gin_idx": { "name": "messages_response_messages_gin_idx", @@ -3068,9 +3050,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "gin", - "with": {} + "concurrently": false }, "messages_reasoning_gin_idx": { "name": "messages_reasoning_gin_idx", @@ -3084,9 +3066,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "gin", - "with": {} + "concurrently": false }, "messages_id_deleted_at_idx": { "name": "messages_id_deleted_at_idx", @@ -3107,37 +3089,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "messages_chat_id_fkey": { "name": "messages_chat_id_fkey", "tableFrom": "messages", - "tableTo": "chats", "columnsFrom": [ "chat_id" ], + "tableTo": "chats", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "messages_created_by_fkey": { "name": "messages_created_by_fkey", "tableFrom": "messages", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -3216,9 +3198,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_files_message_id_idx": { "name": "messages_files_message_id_idx", @@ -3232,9 +3214,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_mtf_active_by_file": { "name": "idx_mtf_active_by_file", @@ -3247,36 +3229,36 @@ } ], "isUnique": false, - "where": "\"messages_to_files\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"messages_to_files\".\"deleted_at\" is null", + "concurrently": false } }, "foreignKeys": { "messages_to_files_message_id_fkey": { "name": "messages_to_files_message_id_fkey", "tableFrom": "messages_to_files", - "tableTo": "messages", "columnsFrom": [ "message_id" ], + "tableTo": "messages", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "messages_to_files_message_id_file_id_key": { "name": "messages_to_files_message_id_file_id_key", - "nullsNotDistinct": false, "columns": [ "message_id", "file_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -3333,9 +3315,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "messages_to_slack_messages_slack_message_id_idx": { "name": "messages_to_slack_messages_slack_message_id_idx", @@ -3349,37 +3331,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "messages_to_slack_messages_message_id_fkey": { "name": "messages_to_slack_messages_message_id_fkey", "tableFrom": "messages_to_slack_messages", - "tableTo": "messages", "columnsFrom": [ "message_id" ], + "tableTo": "messages", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "messages_to_slack_messages_slack_message_id_fkey": { "name": "messages_to_slack_messages_slack_message_id_fkey", "tableFrom": "messages_to_slack_messages", - "tableTo": "slack_message_tracking", "columnsFrom": [ "slack_message_id" ], + "tableTo": "slack_message_tracking", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": { @@ -3553,12 +3535,6 @@ "primaryKey": false, "notNull": false }, - "screenshot_taken_at": { - "name": "screenshot_taken_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, "saved_to_library": { "name": "saved_to_library", "type": "boolean", @@ -3580,9 +3556,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_data_metadata_idx": { "name": "metric_files_data_metadata_idx", @@ -3596,9 +3572,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "gin", - "with": {} + "concurrently": false }, "metric_files_deleted_at_idx": { "name": "metric_files_deleted_at_idx", @@ -3612,9 +3588,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_organization_id_idx": { "name": "metric_files_organization_id_idx", @@ -3628,63 +3604,63 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "metric_files_created_by_fkey": { "name": "metric_files_created_by_fkey", "tableFrom": "metric_files", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "metric_files_publicly_enabled_by_fkey": { "name": "metric_files_publicly_enabled_by_fkey", "tableFrom": "metric_files", - "tableTo": "users", "columnsFrom": [ "publicly_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "fk_data_source": { "name": "fk_data_source", "tableFrom": "metric_files", - "tableTo": "data_sources", "columnsFrom": [ "data_source_id" ], + "tableTo": "data_sources", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "metric_files_workspace_sharing_enabled_by_fkey": { "name": "metric_files_workspace_sharing_enabled_by_fkey", "tableFrom": "metric_files", - "tableTo": "users", "columnsFrom": [ "workspace_sharing_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -3749,9 +3725,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_to_dashboard_files_deleted_at_idx": { "name": "metric_files_to_dashboard_files_deleted_at_idx", @@ -3765,9 +3741,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_to_dashboard_files_metric_id_idx": { "name": "metric_files_to_dashboard_files_metric_id_idx", @@ -3781,50 +3757,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "metric_files_to_dashboard_files_metric_file_id_fkey": { "name": "metric_files_to_dashboard_files_metric_file_id_fkey", "tableFrom": "metric_files_to_dashboard_files", - "tableTo": "metric_files", "columnsFrom": [ "metric_file_id" ], + "tableTo": "metric_files", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "metric_files_to_dashboard_files_dashboard_file_id_fkey": { "name": "metric_files_to_dashboard_files_dashboard_file_id_fkey", "tableFrom": "metric_files_to_dashboard_files", - "tableTo": "dashboard_files", "columnsFrom": [ "dashboard_file_id" ], + "tableTo": "dashboard_files", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "metric_files_to_dashboard_files_created_by_fkey": { "name": "metric_files_to_dashboard_files_created_by_fkey", "tableFrom": "metric_files_to_dashboard_files", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -3876,28 +3852,28 @@ "fk_metric_file": { "name": "fk_metric_file", "tableFrom": "metric_files_to_datasets", - "tableTo": "metric_files", "columnsFrom": [ "metric_file_id" ], + "tableTo": "metric_files", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "fk_dataset": { "name": "fk_dataset", "tableFrom": "metric_files_to_datasets", - "tableTo": "datasets", "columnsFrom": [ "dataset_id" ], + "tableTo": "datasets", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": { @@ -3971,9 +3947,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_to_report_files_deleted_at_idx": { "name": "metric_files_to_report_files_deleted_at_idx", @@ -3987,9 +3963,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "metric_files_to_report_files_metric_id_idx": { "name": "metric_files_to_report_files_metric_id_idx", @@ -4003,50 +3979,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "metric_files_to_report_files_metric_file_id_fkey": { "name": "metric_files_to_report_files_metric_file_id_fkey", "tableFrom": "metric_files_to_report_files", - "tableTo": "metric_files", "columnsFrom": [ "metric_file_id" ], + "tableTo": "metric_files", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "metric_files_to_report_files_report_file_id_fkey": { "name": "metric_files_to_report_files_report_file_id_fkey", "tableFrom": "metric_files_to_report_files", - "tableTo": "report_files", "columnsFrom": [ "report_file_id" ], + "tableTo": "report_files", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "metric_files_to_report_files_created_by_fkey": { "name": "metric_files_to_report_files_created_by_fkey", "tableFrom": "metric_files_to_report_files", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -4148,10 +4124,10 @@ "uniqueConstraints": { "organizations_name_key": { "name": "organizations_name_key", - "nullsNotDistinct": false, "columns": [ "name" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -4219,41 +4195,41 @@ "permission_groups_organization_id_fkey": { "name": "permission_groups_organization_id_fkey", "tableFrom": "permission_groups", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "permission_groups_created_by_fkey": { "name": "permission_groups_created_by_fkey", "tableFrom": "permission_groups", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "permission_groups_updated_by_fkey": { "name": "permission_groups_updated_by_fkey", "tableFrom": "permission_groups", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -4323,28 +4299,28 @@ "permission_groups_to_identities_created_by_fkey": { "name": "permission_groups_to_identities_created_by_fkey", "tableFrom": "permission_groups_to_identities", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "permission_groups_to_identities_updated_by_fkey": { "name": "permission_groups_to_identities_updated_by_fkey", "tableFrom": "permission_groups_to_identities", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -4399,37 +4375,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "permission_groups_to_users_permission_group_id_fkey": { "name": "permission_groups_to_users_permission_group_id_fkey", "tableFrom": "permission_groups_to_users", - "tableTo": "permission_groups", "columnsFrom": [ "permission_group_id" ], + "tableTo": "permission_groups", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "permission_groups_to_users_user_id_fkey": { "name": "permission_groups_to_users_user_id_fkey", "tableFrom": "permission_groups_to_users", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -4569,12 +4545,6 @@ "primaryKey": false, "notNull": false }, - "screenshot_taken_at": { - "name": "screenshot_taken_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, "saved_to_library": { "name": "saved_to_library", "type": "boolean", @@ -4596,9 +4566,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "report_files_deleted_at_idx": { "name": "report_files_deleted_at_idx", @@ -4612,9 +4582,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "report_files_organization_id_idx": { "name": "report_files_organization_id_idx", @@ -4628,63 +4598,63 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "report_files_created_by_fkey": { "name": "report_files_created_by_fkey", "tableFrom": "report_files", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "report_files_publicly_enabled_by_fkey": { "name": "report_files_publicly_enabled_by_fkey", "tableFrom": "report_files", - "tableTo": "users", "columnsFrom": [ "publicly_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "report_files_workspace_sharing_enabled_by_fkey": { "name": "report_files_workspace_sharing_enabled_by_fkey", "tableFrom": "report_files", - "tableTo": "users", "columnsFrom": [ "workspace_sharing_enabled_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "report_files_organization_id_fkey": { "name": "report_files_organization_id_fkey", "tableFrom": "report_files", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -4751,9 +4721,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_s3_integrations_deleted_at": { "name": "idx_s3_integrations_deleted_at", @@ -4766,24 +4736,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "s3_integrations_organization_id_fkey": { "name": "s3_integrations_organization_id_fkey", "tableFrom": "s3_integrations", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -4881,9 +4851,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "shortcuts_name_idx": { "name": "shortcuts_name_idx", @@ -4896,9 +4866,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "shortcuts_workspace_unique": { "name": "shortcuts_workspace_unique", @@ -4917,63 +4887,63 @@ } ], "isUnique": true, - "where": "\"shortcuts\".\"share_with_workspace\" = true", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"shortcuts\".\"share_with_workspace\" = true", + "concurrently": false } }, "foreignKeys": { "shortcuts_created_by_fkey": { "name": "shortcuts_created_by_fkey", "tableFrom": "shortcuts", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "shortcuts_updated_by_fkey": { "name": "shortcuts_updated_by_fkey", "tableFrom": "shortcuts", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "shortcuts_organization_id_fkey": { "name": "shortcuts_organization_id_fkey", "tableFrom": "shortcuts", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "shortcuts_personal_unique": { "name": "shortcuts_personal_unique", - "nullsNotDistinct": false, "columns": [ "name", "organization_id", "created_by" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5139,9 +5109,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_integrations_team_id": { "name": "idx_slack_integrations_team_id", @@ -5155,9 +5125,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_integrations_oauth_state": { "name": "idx_slack_integrations_oauth_state", @@ -5171,9 +5141,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_integrations_oauth_expires": { "name": "idx_slack_integrations_oauth_expires", @@ -5187,62 +5157,62 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "slack_integrations_organization_id_fkey": { "name": "slack_integrations_organization_id_fkey", "tableFrom": "slack_integrations", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "slack_integrations_user_id_fkey": { "name": "slack_integrations_user_id_fkey", "tableFrom": "slack_integrations", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "slack_integrations_oauth_state_unique": { "name": "slack_integrations_oauth_state_unique", - "nullsNotDistinct": false, "columns": [ "oauth_state" - ] + ], + "nullsNotDistinct": false }, "slack_integrations_token_vault_key_unique": { "name": "slack_integrations_token_vault_key_unique", - "nullsNotDistinct": false, "columns": [ "token_vault_key" - ] + ], + "nullsNotDistinct": false }, "slack_integrations_org_team_key": { "name": "slack_integrations_org_team_key", - "nullsNotDistinct": false, "columns": [ "organization_id", "team_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5340,9 +5310,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_message_tracking_channel": { "name": "idx_message_tracking_channel", @@ -5356,9 +5326,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_message_tracking_thread": { "name": "idx_message_tracking_thread", @@ -5372,34 +5342,34 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "slack_message_tracking_integration_id_fkey": { "name": "slack_message_tracking_integration_id_fkey", "tableFrom": "slack_message_tracking", - "tableTo": "slack_integrations", "columnsFrom": [ "integration_id" ], + "tableTo": "slack_integrations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "slack_message_tracking_internal_message_id_unique": { "name": "slack_message_tracking_internal_message_id_unique", - "nullsNotDistinct": false, "columns": [ "internal_message_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5497,38 +5467,38 @@ "teams_organization_id_fkey": { "name": "teams_organization_id_fkey", "tableFrom": "teams", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "teams_created_by_fkey": { "name": "teams_created_by_fkey", "tableFrom": "teams", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "teams_name_key": { "name": "teams_name_key", - "nullsNotDistinct": false, "columns": [ "name" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5585,28 +5555,28 @@ "teams_to_users_team_id_fkey": { "name": "teams_to_users_team_id_fkey", "tableFrom": "teams_to_users", - "tableTo": "teams", "columnsFrom": [ "team_id" ], + "tableTo": "teams", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "teams_to_users_user_id_fkey": { "name": "teams_to_users_user_id_fkey", "tableFrom": "teams_to_users", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -5671,15 +5641,15 @@ "user_favorites_user_id_fkey": { "name": "user_favorites_user_id_fkey", "tableFrom": "user_favorites", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -5789,10 +5759,10 @@ "uniqueConstraints": { "users_email_key": { "name": "users_email_key", - "nullsNotDistinct": false, "columns": [ "email" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5924,77 +5894,77 @@ } ], "isUnique": false, - "where": "\"users_to_organizations\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"users_to_organizations\".\"deleted_at\" is null", + "concurrently": false } }, "foreignKeys": { "users_to_organizations_organization_id_fkey": { "name": "users_to_organizations_organization_id_fkey", "tableFrom": "users_to_organizations", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "users_to_organizations_user_id_fkey": { "name": "users_to_organizations_user_id_fkey", "tableFrom": "users_to_organizations", - "tableTo": "users", "columnsFrom": [ "user_id" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "users_to_organizations_created_by_fkey": { "name": "users_to_organizations_created_by_fkey", "tableFrom": "users_to_organizations", - "tableTo": "users", "columnsFrom": [ "created_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "users_to_organizations_updated_by_fkey": { "name": "users_to_organizations_updated_by_fkey", "tableFrom": "users_to_organizations", - "tableTo": "users", "columnsFrom": [ "updated_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" }, "users_to_organizations_deleted_by_fkey": { "name": "users_to_organizations_deleted_by_fkey", "tableFrom": "users_to_organizations", - "tableTo": "users", "columnsFrom": [ "deleted_by" ], + "tableTo": "users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "no action" } }, "compositePrimaryKeys": { @@ -6219,10 +6189,10 @@ } }, "schemas": {}, + "views": {}, "sequences": {}, "roles": {}, "policies": {}, - "views": {}, "_meta": { "columns": {}, "schemas": {}, diff --git a/packages/database/drizzle/meta/0122_snapshot.json b/packages/database/drizzle/meta/0122_snapshot.json new file mode 100644 index 000000000..eebde5500 --- /dev/null +++ b/packages/database/drizzle/meta/0122_snapshot.json @@ -0,0 +1,6231 @@ +{ + "id": "2a797eeb-1401-4f33-830f-f3e4dde1fce8", + "prevId": "6ea1ae92-5440-4532-8f74-501949f53028", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.api_keys": { + "name": "api_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "owner_id": { + "name": "owner_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "api_keys_organization_id_fkey": { + "name": "api_keys_organization_id_fkey", + "tableFrom": "api_keys", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_keys_owner_id_fkey": { + "name": "api_keys_owner_id_fkey", + "tableFrom": "api_keys", + "tableTo": "users", + "columnsFrom": [ + "owner_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "api_keys_key_key": { + "name": "api_keys_key_key", + "nullsNotDistinct": false, + "columns": [ + "key" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.asset_permissions": { + "name": "asset_permissions", + "schema": "", + "columns": { + "identity_id": { + "name": "identity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_type": { + "name": "identity_type", + "type": "identity_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "asset_permission_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_perm_active_asset_identity": { + "name": "idx_perm_active_asset_identity", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_perm_active_identity_asset": { + "name": "idx_perm_active_identity_asset", + "columns": [ + { + "expression": "identity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "identity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"asset_permissions\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "asset_permissions_created_by_fkey": { + "name": "asset_permissions_created_by_fkey", + "tableFrom": "asset_permissions", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "asset_permissions_updated_by_fkey": { + "name": "asset_permissions_updated_by_fkey", + "tableFrom": "asset_permissions", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "asset_permissions_pkey": { + "name": "asset_permissions_pkey", + "columns": [ + "identity_id", + "identity_type", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.asset_search": { + "name": "asset_search", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "asset_search_asset_id_asset_type_idx": { + "name": "asset_search_asset_id_asset_type_idx", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "pgroonga_content_index": { + "name": "pgroonga_content_index", + "columns": [ + { + "expression": "content", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + } + ], + "isUnique": false, + "concurrently": false, + "method": "pgroonga", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.asset_search_v2": { + "name": "asset_search_v2", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "additional_text": { + "name": "additional_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "pgroonga_search_title_description_index": { + "name": "pgroonga_search_title_description_index", + "columns": [ + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + }, + { + "expression": "additional_text", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "pgroonga_text_full_text_search_ops_v2" + } + ], + "isUnique": false, + "concurrently": false, + "method": "pgroonga", + "with": {} + }, + "idx_as2_active_by_asset": { + "name": "idx_as2_active_by_asset", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_as2_active_by_org": { + "name": "idx_as2_active_by_org", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"asset_search_v2\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "asset_search_v2_organization_id_fkey": { + "name": "asset_search_v2_organization_id_fkey", + "tableFrom": "asset_search_v2", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "asset_search_v2_created_by_fkey": { + "name": "asset_search_v2_created_by_fkey", + "tableFrom": "asset_search_v2", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "asset_search_v2_asset_type_asset_id_unique": { + "name": "asset_search_v2_asset_type_asset_id_unique", + "nullsNotDistinct": false, + "columns": [ + "asset_id", + "asset_type" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chats": { + "name": "chats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "most_recent_file_id": { + "name": "most_recent_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "most_recent_file_type": { + "name": "most_recent_file_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "most_recent_version_number": { + "name": "most_recent_version_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "slack_chat_authorization": { + "name": "slack_chat_authorization", + "type": "slack_chat_authorization_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "slack_thread_ts": { + "name": "slack_thread_ts", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slack_channel_id": { + "name": "slack_channel_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screenshot_taken_at": { + "name": "screenshot_taken_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "chats_created_at_idx": { + "name": "chats_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chats_created_by_idx": { + "name": "chats_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "chats_organization_id_idx": { + "name": "chats_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_chats_most_recent_file_id": { + "name": "idx_chats_most_recent_file_id", + "columns": [ + { + "expression": "most_recent_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_chats_most_recent_file_type": { + "name": "idx_chats_most_recent_file_type", + "columns": [ + { + "expression": "most_recent_file_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chats_organization_id_fkey": { + "name": "chats_organization_id_fkey", + "tableFrom": "chats", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "chats_created_by_fkey": { + "name": "chats_created_by_fkey", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "chats_updated_by_fkey": { + "name": "chats_updated_by_fkey", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "chats_publicly_enabled_by_fkey": { + "name": "chats_publicly_enabled_by_fkey", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": [ + "publicly_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "chats_workspace_sharing_enabled_by_fkey": { + "name": "chats_workspace_sharing_enabled_by_fkey", + "tableFrom": "chats", + "tableTo": "users", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.collections": { + "name": "collections", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screenshot_taken_at": { + "name": "screenshot_taken_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "collections_organization_id_fkey": { + "name": "collections_organization_id_fkey", + "tableFrom": "collections", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "collections_created_by_fkey": { + "name": "collections_created_by_fkey", + "tableFrom": "collections", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "collections_updated_by_fkey": { + "name": "collections_updated_by_fkey", + "tableFrom": "collections", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "collections_workspace_sharing_enabled_by_fkey": { + "name": "collections_workspace_sharing_enabled_by_fkey", + "tableFrom": "collections", + "tableTo": "users", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.collections_to_assets": { + "name": "collections_to_assets", + "schema": "", + "columns": { + "collection_id": { + "name": "collection_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_cta_active_by_asset": { + "name": "idx_cta_active_by_asset", + "columns": [ + { + "expression": "asset_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "asset_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "collection_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"collections_to_assets\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "collections_to_assets_created_by_fkey": { + "name": "collections_to_assets_created_by_fkey", + "tableFrom": "collections_to_assets", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "collections_to_assets_updated_by_fkey": { + "name": "collections_to_assets_updated_by_fkey", + "tableFrom": "collections_to_assets", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "collections_to_assets_pkey": { + "name": "collections_to_assets_pkey", + "columns": [ + "collection_id", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dashboard_files": { + "name": "dashboard_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "filter": { + "name": "filter", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screenshot_taken_at": { + "name": "screenshot_taken_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "dashboard_files_created_by_idx": { + "name": "dashboard_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dashboard_files_deleted_at_idx": { + "name": "dashboard_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dashboard_files_organization_id_idx": { + "name": "dashboard_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dashboard_files_created_by_fkey": { + "name": "dashboard_files_created_by_fkey", + "tableFrom": "dashboard_files", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "dashboard_files_publicly_enabled_by_fkey": { + "name": "dashboard_files_publicly_enabled_by_fkey", + "tableFrom": "dashboard_files", + "tableTo": "users", + "columnsFrom": [ + "publicly_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "dashboard_files_workspace_sharing_enabled_by_fkey": { + "name": "dashboard_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "dashboard_files", + "tableTo": "users", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.data_sources": { + "name": "data_sources", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret_id": { + "name": "secret_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "onboarding_status": { + "name": "onboarding_status", + "type": "data_source_onboarding_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'notStarted'" + }, + "onboarding_error": { + "name": "onboarding_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "env": { + "name": "env", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'dev'" + } + }, + "indexes": {}, + "foreignKeys": { + "data_sources_organization_id_fkey": { + "name": "data_sources_organization_id_fkey", + "tableFrom": "data_sources", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "data_sources_created_by_fkey": { + "name": "data_sources_created_by_fkey", + "tableFrom": "data_sources", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "data_sources_updated_by_fkey": { + "name": "data_sources_updated_by_fkey", + "tableFrom": "data_sources", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "data_sources_name_organization_id_env_key": { + "name": "data_sources_name_organization_id_env_key", + "nullsNotDistinct": false, + "columns": [ + "name", + "organization_id", + "env" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_groups": { + "name": "dataset_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_groups_deleted_at_idx": { + "name": "dataset_groups_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_groups_organization_id_idx": { + "name": "dataset_groups_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dataset_groups_organization_id_fkey": { + "name": "dataset_groups_organization_id_fkey", + "tableFrom": "dataset_groups", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": { + "dataset_groups_policy": { + "name": "dataset_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_groups_permissions": { + "name": "dataset_groups_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "dataset_group_id": { + "name": "dataset_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_id": { + "name": "permission_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_type": { + "name": "permission_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_groups_permissions_dataset_group_id_idx": { + "name": "dataset_groups_permissions_dataset_group_id_idx", + "columns": [ + { + "expression": "dataset_group_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_groups_permissions_organization_id_idx": { + "name": "dataset_groups_permissions_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_groups_permissions_permission_id_idx": { + "name": "dataset_groups_permissions_permission_id_idx", + "columns": [ + { + "expression": "permission_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dataset_groups_permissions_dataset_group_id_fkey": { + "name": "dataset_groups_permissions_dataset_group_id_fkey", + "tableFrom": "dataset_groups_permissions", + "tableTo": "dataset_groups", + "columnsFrom": [ + "dataset_group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dataset_groups_permissions_organization_id_fkey": { + "name": "dataset_groups_permissions_organization_id_fkey", + "tableFrom": "dataset_groups_permissions", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_dataset_group_permission": { + "name": "unique_dataset_group_permission", + "nullsNotDistinct": false, + "columns": [ + "dataset_group_id", + "permission_id", + "permission_type" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dataset_permissions": { + "name": "dataset_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_id": { + "name": "permission_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_type": { + "name": "permission_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "dataset_permissions_dataset_id_idx": { + "name": "dataset_permissions_dataset_id_idx", + "columns": [ + { + "expression": "dataset_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_permissions_deleted_at_idx": { + "name": "dataset_permissions_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_permissions_organization_id_idx": { + "name": "dataset_permissions_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "dataset_permissions_permission_lookup_idx": { + "name": "dataset_permissions_permission_lookup_idx", + "columns": [ + { + "expression": "permission_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "permission_type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "dataset_permissions_organization_id_fkey": { + "name": "dataset_permissions_organization_id_fkey", + "tableFrom": "dataset_permissions", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "dataset_permissions_dataset_id_fkey": { + "name": "dataset_permissions_dataset_id_fkey", + "tableFrom": "dataset_permissions", + "tableTo": "datasets", + "columnsFrom": [ + "dataset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dataset_permissions_dataset_id_permission_id_permission_typ_key": { + "name": "dataset_permissions_dataset_id_permission_id_permission_typ_key", + "nullsNotDistinct": false, + "columns": [ + "dataset_id", + "permission_id", + "permission_type" + ] + } + }, + "policies": { + "dataset_permissions_policy": { + "name": "dataset_permissions_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": { + "dataset_permissions_permission_type_check": { + "name": "dataset_permissions_permission_type_check", + "value": "(permission_type)::text = ANY ((ARRAY['user'::character varying, 'dataset_group'::character varying, 'permission_group'::character varying])::text[])" + } + }, + "isRLSEnabled": false + }, + "public.datasets": { + "name": "datasets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "database_name": { + "name": "database_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "when_to_use": { + "name": "when_to_use", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "when_not_to_use": { + "name": "when_not_to_use", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "dataset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "definition": { + "name": "definition", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "imported": { + "name": "imported", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "yml_file": { + "name": "yml_file", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "database_identifier": { + "name": "database_identifier", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "datasets_data_source_id_fkey": { + "name": "datasets_data_source_id_fkey", + "tableFrom": "datasets", + "tableTo": "data_sources", + "columnsFrom": [ + "data_source_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "datasets_organization_id_fkey": { + "name": "datasets_organization_id_fkey", + "tableFrom": "datasets", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "datasets_created_by_fkey": { + "name": "datasets_created_by_fkey", + "tableFrom": "datasets", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "datasets_updated_by_fkey": { + "name": "datasets_updated_by_fkey", + "tableFrom": "datasets", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "datasets_name_schema_database_identifier_data_source_id_key": { + "name": "datasets_name_schema_database_identifier_data_source_id_key", + "nullsNotDistinct": false, + "columns": [ + "name", + "schema", + "database_identifier", + "data_source_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.datasets_to_dataset_groups": { + "name": "datasets_to_dataset_groups", + "schema": "", + "columns": { + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_group_id": { + "name": "dataset_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "datasets_to_dataset_groups_dataset_group_id_idx": { + "name": "datasets_to_dataset_groups_dataset_group_id_idx", + "columns": [ + { + "expression": "dataset_group_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "datasets_to_dataset_groups_dataset_id_fkey": { + "name": "datasets_to_dataset_groups_dataset_id_fkey", + "tableFrom": "datasets_to_dataset_groups", + "tableTo": "datasets", + "columnsFrom": [ + "dataset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "datasets_to_dataset_groups_dataset_group_id_fkey": { + "name": "datasets_to_dataset_groups_dataset_group_id_fkey", + "tableFrom": "datasets_to_dataset_groups", + "tableTo": "dataset_groups", + "columnsFrom": [ + "dataset_group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "datasets_to_dataset_groups_pkey": { + "name": "datasets_to_dataset_groups_pkey", + "columns": [ + "dataset_id", + "dataset_group_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "datasets_to_dataset_groups_policy": { + "name": "datasets_to_dataset_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.datasets_to_permission_groups": { + "name": "datasets_to_permission_groups", + "schema": "", + "columns": { + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "datasets_to_permission_groups_dataset_id_fkey": { + "name": "datasets_to_permission_groups_dataset_id_fkey", + "tableFrom": "datasets_to_permission_groups", + "tableTo": "datasets", + "columnsFrom": [ + "dataset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "datasets_to_permission_groups_permission_group_id_fkey": { + "name": "datasets_to_permission_groups_permission_group_id_fkey", + "tableFrom": "datasets_to_permission_groups", + "tableTo": "permission_groups", + "columnsFrom": [ + "permission_group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "datasets_to_permission_groups_pkey": { + "name": "datasets_to_permission_groups_pkey", + "columns": [ + "dataset_id", + "permission_group_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "datasets_to_permission_groups_policy": { + "name": "datasets_to_permission_groups_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.docs": { + "name": "docs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "docs_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'normal'" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "docs_organization_id_fkey": { + "name": "docs_organization_id_fkey", + "tableFrom": "docs", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "docs_name_organization_id_key": { + "name": "docs_name_organization_id_key", + "nullsNotDistinct": false, + "columns": [ + "name", + "organization_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.github_integrations": { + "name": "github_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "installation_id": { + "name": "installation_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "app_id": { + "name": "app_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "github_org_id": { + "name": "github_org_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "github_org_name": { + "name": "github_org_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "token_vault_key": { + "name": "token_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "webhook_secret_vault_key": { + "name": "webhook_secret_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "repository_permissions": { + "name": "repository_permissions", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "status": { + "name": "status", + "type": "github_integration_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "installed_at": { + "name": "installed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_github_integrations_org_id": { + "name": "idx_github_integrations_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_github_integrations_installation_id": { + "name": "idx_github_integrations_installation_id", + "columns": [ + { + "expression": "installation_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_github_integrations_github_org_id": { + "name": "idx_github_integrations_github_org_id", + "columns": [ + { + "expression": "github_org_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "github_integrations_organization_id_fkey": { + "name": "github_integrations_organization_id_fkey", + "tableFrom": "github_integrations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "github_integrations_user_id_fkey": { + "name": "github_integrations_user_id_fkey", + "tableFrom": "github_integrations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "github_integrations_token_vault_key_unique": { + "name": "github_integrations_token_vault_key_unique", + "nullsNotDistinct": false, + "columns": [ + "token_vault_key" + ] + }, + "github_integrations_org_installation_key": { + "name": "github_integrations_org_installation_key", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "installation_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs_write_back_configs": { + "name": "logs_write_back_configs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "database": { + "name": "database", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "table_name": { + "name": "table_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'buster_query_logs'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "logs_write_back_configs_org_unique": { + "name": "logs_write_back_configs_org_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"logs_write_back_configs\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_logs_write_back_configs_org_id": { + "name": "idx_logs_write_back_configs_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_logs_write_back_configs_data_source_id": { + "name": "idx_logs_write_back_configs_data_source_id", + "columns": [ + { + "expression": "data_source_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_logs_write_back_configs_deleted_at": { + "name": "idx_logs_write_back_configs_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "logs_write_back_configs_organization_id_fkey": { + "name": "logs_write_back_configs_organization_id_fkey", + "tableFrom": "logs_write_back_configs", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "logs_write_back_configs_data_source_id_fkey": { + "name": "logs_write_back_configs_data_source_id_fkey", + "tableFrom": "logs_write_back_configs", + "tableTo": "data_sources", + "columnsFrom": [ + "data_source_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages": { + "name": "messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "request_message": { + "name": "request_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_messages": { + "name": "response_messages", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "message_analysis_mode": { + "name": "message_analysis_mode", + "type": "message_analysis_mode_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'auto'" + }, + "reasoning": { + "name": "reasoning", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "raw_llm_messages": { + "name": "raw_llm_messages", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "final_reasoning_message": { + "name": "final_reasoning_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "feedback": { + "name": "feedback", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_completed": { + "name": "is_completed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "post_processing_message": { + "name": "post_processing_message", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "trigger_run_id": { + "name": "trigger_run_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + } + }, + "indexes": { + "messages_chat_id_idx": { + "name": "messages_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_created_at_idx": { + "name": "messages_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_created_by_idx": { + "name": "messages_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_deleted_at_idx": { + "name": "messages_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_raw_llm_messages_gin_idx": { + "name": "messages_raw_llm_messages_gin_idx", + "columns": [ + { + "expression": "raw_llm_messages", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "messages_response_messages_gin_idx": { + "name": "messages_response_messages_gin_idx", + "columns": [ + { + "expression": "response_messages", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "messages_reasoning_gin_idx": { + "name": "messages_reasoning_gin_idx", + "columns": [ + { + "expression": "reasoning", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "messages_id_deleted_at_idx": { + "name": "messages_id_deleted_at_idx", + "columns": [ + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "messages_chat_id_fkey": { + "name": "messages_chat_id_fkey", + "tableFrom": "messages", + "tableTo": "chats", + "columnsFrom": [ + "chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "messages_created_by_fkey": { + "name": "messages_created_by_fkey", + "tableFrom": "messages", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages_to_files": { + "name": "messages_to_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_duplicate": { + "name": "is_duplicate", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "version_number": { + "name": "version_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + } + }, + "indexes": { + "messages_files_file_id_idx": { + "name": "messages_files_file_id_idx", + "columns": [ + { + "expression": "file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_files_message_id_idx": { + "name": "messages_files_message_id_idx", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_mtf_active_by_file": { + "name": "idx_mtf_active_by_file", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"messages_to_files\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "messages_to_files_message_id_fkey": { + "name": "messages_to_files_message_id_fkey", + "tableFrom": "messages_to_files", + "tableTo": "messages", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "messages_to_files_message_id_file_id_key": { + "name": "messages_to_files_message_id_file_id_key", + "nullsNotDistinct": false, + "columns": [ + "message_id", + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.messages_to_slack_messages": { + "name": "messages_to_slack_messages", + "schema": "", + "columns": { + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slack_message_id": { + "name": "slack_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "messages_to_slack_messages_message_id_idx": { + "name": "messages_to_slack_messages_message_id_idx", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "messages_to_slack_messages_slack_message_id_idx": { + "name": "messages_to_slack_messages_slack_message_id_idx", + "columns": [ + { + "expression": "slack_message_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "messages_to_slack_messages_message_id_fkey": { + "name": "messages_to_slack_messages_message_id_fkey", + "tableFrom": "messages_to_slack_messages", + "tableTo": "messages", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "messages_to_slack_messages_slack_message_id_fkey": { + "name": "messages_to_slack_messages_slack_message_id_fkey", + "tableFrom": "messages_to_slack_messages", + "tableTo": "slack_message_tracking", + "columnsFrom": [ + "slack_message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "messages_to_slack_messages_pkey": { + "name": "messages_to_slack_messages_pkey", + "columns": [ + "message_id", + "slack_message_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files": { + "name": "metric_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "file_name": { + "name": "file_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "verification": { + "name": "verification", + "type": "verification_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'notRequested'" + }, + "evaluation_obj": { + "name": "evaluation_obj", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "evaluation_summary": { + "name": "evaluation_summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evaluation_score": { + "name": "evaluation_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "data_metadata": { + "name": "data_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "data_source_id": { + "name": "data_source_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screenshot_taken_at": { + "name": "screenshot_taken_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "metric_files_created_by_idx": { + "name": "metric_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_data_metadata_idx": { + "name": "metric_files_data_metadata_idx", + "columns": [ + { + "expression": "data_metadata", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "jsonb_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "metric_files_deleted_at_idx": { + "name": "metric_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_organization_id_idx": { + "name": "metric_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "metric_files_created_by_fkey": { + "name": "metric_files_created_by_fkey", + "tableFrom": "metric_files", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "metric_files_publicly_enabled_by_fkey": { + "name": "metric_files_publicly_enabled_by_fkey", + "tableFrom": "metric_files", + "tableTo": "users", + "columnsFrom": [ + "publicly_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "fk_data_source": { + "name": "fk_data_source", + "tableFrom": "metric_files", + "tableTo": "data_sources", + "columnsFrom": [ + "data_source_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "metric_files_workspace_sharing_enabled_by_fkey": { + "name": "metric_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "metric_files", + "tableTo": "users", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_dashboard_files": { + "name": "metric_files_to_dashboard_files", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dashboard_file_id": { + "name": "dashboard_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "metric_files_to_dashboard_files_dashboard_id_idx": { + "name": "metric_files_to_dashboard_files_dashboard_id_idx", + "columns": [ + { + "expression": "dashboard_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_to_dashboard_files_deleted_at_idx": { + "name": "metric_files_to_dashboard_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_to_dashboard_files_metric_id_idx": { + "name": "metric_files_to_dashboard_files_metric_id_idx", + "columns": [ + { + "expression": "metric_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "metric_files_to_dashboard_files_metric_file_id_fkey": { + "name": "metric_files_to_dashboard_files_metric_file_id_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "tableTo": "metric_files", + "columnsFrom": [ + "metric_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "metric_files_to_dashboard_files_dashboard_file_id_fkey": { + "name": "metric_files_to_dashboard_files_dashboard_file_id_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "tableTo": "dashboard_files", + "columnsFrom": [ + "dashboard_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "metric_files_to_dashboard_files_created_by_fkey": { + "name": "metric_files_to_dashboard_files_created_by_fkey", + "tableFrom": "metric_files_to_dashboard_files", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "metric_files_to_dashboard_files_pkey": { + "name": "metric_files_to_dashboard_files_pkey", + "columns": [ + "metric_file_id", + "dashboard_file_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_datasets": { + "name": "metric_files_to_datasets", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "dataset_id": { + "name": "dataset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "metric_version_number": { + "name": "metric_version_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "fk_metric_file": { + "name": "fk_metric_file", + "tableFrom": "metric_files_to_datasets", + "tableTo": "metric_files", + "columnsFrom": [ + "metric_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "fk_dataset": { + "name": "fk_dataset", + "tableFrom": "metric_files_to_datasets", + "tableTo": "datasets", + "columnsFrom": [ + "dataset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "metric_files_to_datasets_pkey": { + "name": "metric_files_to_datasets_pkey", + "columns": [ + "metric_file_id", + "dataset_id", + "metric_version_number" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.metric_files_to_report_files": { + "name": "metric_files_to_report_files", + "schema": "", + "columns": { + "metric_file_id": { + "name": "metric_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "report_file_id": { + "name": "report_file_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "metric_files_to_report_files_report_id_idx": { + "name": "metric_files_to_report_files_report_id_idx", + "columns": [ + { + "expression": "report_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_to_report_files_deleted_at_idx": { + "name": "metric_files_to_report_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "metric_files_to_report_files_metric_id_idx": { + "name": "metric_files_to_report_files_metric_id_idx", + "columns": [ + { + "expression": "metric_file_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "metric_files_to_report_files_metric_file_id_fkey": { + "name": "metric_files_to_report_files_metric_file_id_fkey", + "tableFrom": "metric_files_to_report_files", + "tableTo": "metric_files", + "columnsFrom": [ + "metric_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "metric_files_to_report_files_report_file_id_fkey": { + "name": "metric_files_to_report_files_report_file_id_fkey", + "tableFrom": "metric_files_to_report_files", + "tableTo": "report_files", + "columnsFrom": [ + "report_file_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "metric_files_to_report_files_created_by_fkey": { + "name": "metric_files_to_report_files_created_by_fkey", + "tableFrom": "metric_files_to_report_files", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "metric_files_to_report_files_pkey": { + "name": "metric_files_to_report_files_pkey", + "columns": [ + "metric_file_id", + "report_file_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organizations": { + "name": "organizations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payment_required": { + "name": "payment_required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "domains": { + "name": "domains", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "restrict_new_user_invitations": { + "name": "restrict_new_user_invitations", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "default_role": { + "name": "default_role", + "type": "user_organization_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'restricted_querier'" + }, + "organization_color_palettes": { + "name": "organization_color_palettes", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\"selectedId\": null, \"palettes\": [], \"selectedDictionaryPalette\": null}'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "organizations_name_key": { + "name": "organizations_name_key", + "nullsNotDistinct": false, + "columns": [ + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups": { + "name": "permission_groups", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "permission_groups_organization_id_fkey": { + "name": "permission_groups_organization_id_fkey", + "tableFrom": "permission_groups", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_groups_created_by_fkey": { + "name": "permission_groups_created_by_fkey", + "tableFrom": "permission_groups", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "permission_groups_updated_by_fkey": { + "name": "permission_groups_updated_by_fkey", + "tableFrom": "permission_groups", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups_to_identities": { + "name": "permission_groups_to_identities", + "schema": "", + "columns": { + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_id": { + "name": "identity_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "identity_type": { + "name": "identity_type", + "type": "identity_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "permission_groups_to_identities_created_by_fkey": { + "name": "permission_groups_to_identities_created_by_fkey", + "tableFrom": "permission_groups_to_identities", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "permission_groups_to_identities_updated_by_fkey": { + "name": "permission_groups_to_identities_updated_by_fkey", + "tableFrom": "permission_groups_to_identities", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "permission_groups_to_identities_pkey": { + "name": "permission_groups_to_identities_pkey", + "columns": [ + "permission_group_id", + "identity_id", + "identity_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_groups_to_users": { + "name": "permission_groups_to_users", + "schema": "", + "columns": { + "permission_group_id": { + "name": "permission_group_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permission_groups_to_users_user_id_idx": { + "name": "permission_groups_to_users_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "permission_groups_to_users_permission_group_id_fkey": { + "name": "permission_groups_to_users_permission_group_id_fkey", + "tableFrom": "permission_groups_to_users", + "tableTo": "permission_groups", + "columnsFrom": [ + "permission_group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_groups_to_users_user_id_fkey": { + "name": "permission_groups_to_users_user_id_fkey", + "tableFrom": "permission_groups_to_users", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "permission_groups_to_users_pkey": { + "name": "permission_groups_to_users_pkey", + "columns": [ + "permission_group_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": { + "permission_groups_to_users_policy": { + "name": "permission_groups_to_users_policy", + "as": "PERMISSIVE", + "for": "ALL", + "to": [ + "authenticated" + ], + "using": "true" + } + }, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.report_files": { + "name": "report_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "publicly_accessible": { + "name": "publicly_accessible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "publicly_enabled_by": { + "name": "publicly_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_expiry_date": { + "name": "public_expiry_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "version_history": { + "name": "version_history", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "public_password": { + "name": "public_password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing": { + "name": "workspace_sharing", + "type": "workspace_sharing_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "workspace_sharing_enabled_by": { + "name": "workspace_sharing_enabled_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_sharing_enabled_at": { + "name": "workspace_sharing_enabled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "screenshot_bucket_key": { + "name": "screenshot_bucket_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "screenshot_taken_at": { + "name": "screenshot_taken_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "saved_to_library": { + "name": "saved_to_library", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "report_files_created_by_idx": { + "name": "report_files_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "report_files_deleted_at_idx": { + "name": "report_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "report_files_organization_id_idx": { + "name": "report_files_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "report_files_created_by_fkey": { + "name": "report_files_created_by_fkey", + "tableFrom": "report_files", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "report_files_publicly_enabled_by_fkey": { + "name": "report_files_publicly_enabled_by_fkey", + "tableFrom": "report_files", + "tableTo": "users", + "columnsFrom": [ + "publicly_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "report_files_workspace_sharing_enabled_by_fkey": { + "name": "report_files_workspace_sharing_enabled_by_fkey", + "tableFrom": "report_files", + "tableTo": "users", + "columnsFrom": [ + "workspace_sharing_enabled_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "report_files_organization_id_fkey": { + "name": "report_files_organization_id_fkey", + "tableFrom": "report_files", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.s3_integrations": { + "name": "s3_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "provider": { + "name": "provider", + "type": "storage_provider_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "idx_s3_integrations_organization_id": { + "name": "idx_s3_integrations_organization_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_s3_integrations_deleted_at": { + "name": "idx_s3_integrations_deleted_at", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "s3_integrations_organization_id_fkey": { + "name": "s3_integrations_organization_id_fkey", + "tableFrom": "s3_integrations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shortcuts": { + "name": "shortcuts", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "instructions": { + "name": "instructions", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "share_with_workspace": { + "name": "share_with_workspace", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "shortcuts_org_user_idx": { + "name": "shortcuts_org_user_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "shortcuts_name_idx": { + "name": "shortcuts_name_idx", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "shortcuts_workspace_unique": { + "name": "shortcuts_workspace_unique", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"shortcuts\".\"share_with_workspace\" = true", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "shortcuts_created_by_fkey": { + "name": "shortcuts_created_by_fkey", + "tableFrom": "shortcuts", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "shortcuts_updated_by_fkey": { + "name": "shortcuts_updated_by_fkey", + "tableFrom": "shortcuts", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "shortcuts_organization_id_fkey": { + "name": "shortcuts_organization_id_fkey", + "tableFrom": "shortcuts", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shortcuts_personal_unique": { + "name": "shortcuts_personal_unique", + "nullsNotDistinct": false, + "columns": [ + "name", + "organization_id", + "created_by" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.slack_integrations": { + "name": "slack_integrations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "oauth_state": { + "name": "oauth_state", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "oauth_expires_at": { + "name": "oauth_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "oauth_metadata": { + "name": "oauth_metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "team_id": { + "name": "team_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "team_name": { + "name": "team_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "team_domain": { + "name": "team_domain", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "enterprise_id": { + "name": "enterprise_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "bot_user_id": { + "name": "bot_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_vault_key": { + "name": "token_vault_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "installed_by_slack_user_id": { + "name": "installed_by_slack_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "installed_at": { + "name": "installed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "slack_integration_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "default_channel": { + "name": "default_channel", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "default_sharing_permissions": { + "name": "default_sharing_permissions", + "type": "slack_sharing_permission_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'shareWithChannel'" + } + }, + "indexes": { + "idx_slack_integrations_org_id": { + "name": "idx_slack_integrations_org_id", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_slack_integrations_team_id": { + "name": "idx_slack_integrations_team_id", + "columns": [ + { + "expression": "team_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_slack_integrations_oauth_state": { + "name": "idx_slack_integrations_oauth_state", + "columns": [ + { + "expression": "oauth_state", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_slack_integrations_oauth_expires": { + "name": "idx_slack_integrations_oauth_expires", + "columns": [ + { + "expression": "oauth_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "slack_integrations_organization_id_fkey": { + "name": "slack_integrations_organization_id_fkey", + "tableFrom": "slack_integrations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "slack_integrations_user_id_fkey": { + "name": "slack_integrations_user_id_fkey", + "tableFrom": "slack_integrations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slack_integrations_oauth_state_unique": { + "name": "slack_integrations_oauth_state_unique", + "nullsNotDistinct": false, + "columns": [ + "oauth_state" + ] + }, + "slack_integrations_token_vault_key_unique": { + "name": "slack_integrations_token_vault_key_unique", + "nullsNotDistinct": false, + "columns": [ + "token_vault_key" + ] + }, + "slack_integrations_org_team_key": { + "name": "slack_integrations_org_team_key", + "nullsNotDistinct": false, + "columns": [ + "organization_id", + "team_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "slack_integrations_status_check": { + "name": "slack_integrations_status_check", + "value": "(status = 'pending' AND oauth_state IS NOT NULL) OR (status != 'pending' AND team_id IS NOT NULL)" + } + }, + "isRLSEnabled": false + }, + "public.slack_message_tracking": { + "name": "slack_message_tracking", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "integration_id": { + "name": "integration_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "internal_message_id": { + "name": "internal_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "slack_channel_id": { + "name": "slack_channel_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "slack_message_ts": { + "name": "slack_message_ts", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "slack_thread_ts": { + "name": "slack_thread_ts", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "message_type": { + "name": "message_type", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sender_info": { + "name": "sender_info", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "sent_at": { + "name": "sent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idx_message_tracking_integration": { + "name": "idx_message_tracking_integration", + "columns": [ + { + "expression": "integration_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_message_tracking_channel": { + "name": "idx_message_tracking_channel", + "columns": [ + { + "expression": "slack_channel_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_message_tracking_thread": { + "name": "idx_message_tracking_thread", + "columns": [ + { + "expression": "slack_thread_ts", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "slack_message_tracking_integration_id_fkey": { + "name": "slack_message_tracking_integration_id_fkey", + "tableFrom": "slack_message_tracking", + "tableTo": "slack_integrations", + "columnsFrom": [ + "integration_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "slack_message_tracking_internal_message_id_unique": { + "name": "slack_message_tracking_internal_message_id_unique", + "nullsNotDistinct": false, + "columns": [ + "internal_message_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.teams": { + "name": "teams", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sharing_setting": { + "name": "sharing_setting", + "type": "sharing_setting_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "edit_sql": { + "name": "edit_sql", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "upload_csv": { + "name": "upload_csv", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "export_assets": { + "name": "export_assets", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "email_slack_enabled": { + "name": "email_slack_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "teams_organization_id_fkey": { + "name": "teams_organization_id_fkey", + "tableFrom": "teams", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "teams_created_by_fkey": { + "name": "teams_created_by_fkey", + "tableFrom": "teams", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "teams_name_key": { + "name": "teams_name_key", + "nullsNotDistinct": false, + "columns": [ + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.teams_to_users": { + "name": "teams_to_users", + "schema": "", + "columns": { + "team_id": { + "name": "team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "team_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "teams_to_users_team_id_fkey": { + "name": "teams_to_users_team_id_fkey", + "tableFrom": "teams_to_users", + "tableTo": "teams", + "columnsFrom": [ + "team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "teams_to_users_user_id_fkey": { + "name": "teams_to_users_user_id_fkey", + "tableFrom": "teams_to_users", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "teams_to_users_pkey": { + "name": "teams_to_users_pkey", + "columns": [ + "team_id", + "user_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_favorites": { + "name": "user_favorites", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_id": { + "name": "asset_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "asset_type": { + "name": "asset_type", + "type": "asset_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "order_index": { + "name": "order_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_favorites_user_id_fkey": { + "name": "user_favorites_user_id_fkey", + "tableFrom": "user_favorites", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "user_favorites_pkey": { + "name": "user_favorites_pkey", + "columns": [ + "user_id", + "asset_id", + "asset_type" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "attributes": { + "name": "attributes", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "avatar_url": { + "name": "avatar_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "suggested_prompts": { + "name": "suggested_prompts", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{\n \"suggestedPrompts\": {\n \"report\": [\n \"provide a trend analysis of quarterly profits\",\n \"evaluate product performance across regions\"\n ],\n \"dashboard\": [\n \"create a sales performance dashboard\",\n \"design a revenue forecast dashboard\"\n ],\n \"visualization\": [\n \"create a metric for monthly sales\",\n \"show top vendors by purchase volume\"\n ],\n \"help\": [\n \"what types of analyses can you perform?\",\n \"what questions can I ask buster?\",\n \"what data models are available for queries?\",\n \"can you explain your forecasting capabilities?\"\n ]\n },\n \"updatedAt\": \"2024-01-01T00:00:00.000Z\"\n }'::jsonb" + }, + "personalization_enabled": { + "name": "personalization_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "personalization_config": { + "name": "personalization_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "last_used_shortcuts": { + "name": "last_used_shortcuts", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_email_key": { + "name": "users_email_key", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users_to_organizations": { + "name": "users_to_organizations", + "schema": "", + "columns": { + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "user_organization_role_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'querier'" + }, + "sharing_setting": { + "name": "sharing_setting", + "type": "sharing_setting_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "edit_sql": { + "name": "edit_sql", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "upload_csv": { + "name": "upload_csv", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "export_assets": { + "name": "export_assets", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "email_slack_enabled": { + "name": "email_slack_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deleted_by": { + "name": "deleted_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "user_organization_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + } + }, + "indexes": { + "idx_uto_active_by_user": { + "name": "idx_uto_active_by_user", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"users_to_organizations\".\"deleted_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "users_to_organizations_organization_id_fkey": { + "name": "users_to_organizations_organization_id_fkey", + "tableFrom": "users_to_organizations", + "tableTo": "organizations", + "columnsFrom": [ + "organization_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "users_to_organizations_user_id_fkey": { + "name": "users_to_organizations_user_id_fkey", + "tableFrom": "users_to_organizations", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "users_to_organizations_created_by_fkey": { + "name": "users_to_organizations_created_by_fkey", + "tableFrom": "users_to_organizations", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "users_to_organizations_updated_by_fkey": { + "name": "users_to_organizations_updated_by_fkey", + "tableFrom": "users_to_organizations", + "tableTo": "users", + "columnsFrom": [ + "updated_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + }, + "users_to_organizations_deleted_by_fkey": { + "name": "users_to_organizations_deleted_by_fkey", + "tableFrom": "users_to_organizations", + "tableTo": "users", + "columnsFrom": [ + "deleted_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": { + "users_to_organizations_pkey": { + "name": "users_to_organizations_pkey", + "columns": [ + "user_id", + "organization_id" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.asset_permission_role_enum": { + "name": "asset_permission_role_enum", + "schema": "public", + "values": [ + "owner", + "viewer", + "can_view", + "can_filter", + "can_edit", + "full_access" + ] + }, + "public.asset_type_enum": { + "name": "asset_type_enum", + "schema": "public", + "values": [ + "chat", + "metric_file", + "dashboard_file", + "report_file", + "collection" + ] + }, + "public.data_source_onboarding_status_enum": { + "name": "data_source_onboarding_status_enum", + "schema": "public", + "values": [ + "notStarted", + "inProgress", + "completed", + "failed" + ] + }, + "public.dataset_type_enum": { + "name": "dataset_type_enum", + "schema": "public", + "values": [ + "table", + "view", + "materializedView" + ] + }, + "public.docs_type_enum": { + "name": "docs_type_enum", + "schema": "public", + "values": [ + "analyst", + "normal" + ] + }, + "public.github_integration_status_enum": { + "name": "github_integration_status_enum", + "schema": "public", + "values": [ + "pending", + "active", + "suspended", + "revoked" + ] + }, + "public.identity_type_enum": { + "name": "identity_type_enum", + "schema": "public", + "values": [ + "user", + "team", + "organization" + ] + }, + "public.message_analysis_mode_enum": { + "name": "message_analysis_mode_enum", + "schema": "public", + "values": [ + "auto", + "standard", + "investigation" + ] + }, + "public.message_feedback_enum": { + "name": "message_feedback_enum", + "schema": "public", + "values": [ + "positive", + "negative" + ] + }, + "public.sharing_setting_enum": { + "name": "sharing_setting_enum", + "schema": "public", + "values": [ + "none", + "team", + "organization", + "public" + ] + }, + "public.slack_chat_authorization_enum": { + "name": "slack_chat_authorization_enum", + "schema": "public", + "values": [ + "unauthorized", + "authorized", + "auto_added" + ] + }, + "public.slack_integration_status_enum": { + "name": "slack_integration_status_enum", + "schema": "public", + "values": [ + "pending", + "active", + "failed", + "revoked" + ] + }, + "public.slack_sharing_permission_enum": { + "name": "slack_sharing_permission_enum", + "schema": "public", + "values": [ + "shareWithWorkspace", + "shareWithChannel", + "noSharing" + ] + }, + "public.storage_provider_enum": { + "name": "storage_provider_enum", + "schema": "public", + "values": [ + "s3", + "r2", + "gcs" + ] + }, + "public.stored_values_status_enum": { + "name": "stored_values_status_enum", + "schema": "public", + "values": [ + "syncing", + "success", + "failed" + ] + }, + "public.table_type_enum": { + "name": "table_type_enum", + "schema": "public", + "values": [ + "TABLE", + "VIEW", + "MATERIALIZED_VIEW", + "EXTERNAL_TABLE", + "TEMPORARY_TABLE" + ] + }, + "public.team_role_enum": { + "name": "team_role_enum", + "schema": "public", + "values": [ + "manager", + "member", + "none" + ] + }, + "public.user_organization_role_enum": { + "name": "user_organization_role_enum", + "schema": "public", + "values": [ + "workspace_admin", + "data_admin", + "querier", + "restricted_querier", + "viewer" + ] + }, + "public.user_organization_status_enum": { + "name": "user_organization_status_enum", + "schema": "public", + "values": [ + "active", + "inactive", + "pending", + "guest" + ] + }, + "public.verification_enum": { + "name": "verification_enum", + "schema": "public", + "values": [ + "verified", + "backlogged", + "inReview", + "requested", + "notRequested" + ] + }, + "public.workspace_sharing_enum": { + "name": "workspace_sharing_enum", + "schema": "public", + "values": [ + "none", + "can_view", + "can_edit", + "full_access" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/database/drizzle/meta/_journal.json b/packages/database/drizzle/meta/_journal.json index da7e00a02..070a4d249 100644 --- a/packages/database/drizzle/meta/_journal.json +++ b/packages/database/drizzle/meta/_journal.json @@ -835,25 +835,25 @@ "tag": "0119_grey_shatterstar", "breakpoints": true }, - { - "idx": 119, - "version": "7", - "when": 1759868105747, - "tag": "0119_careful_shriek", - "breakpoints": true - }, { "idx": 120, "version": "7", - "when": 1759868882572, - "tag": "0120_aberrant_xavin", + "when": 1759868105747, + "tag": "0120_careful_shriek", "breakpoints": true }, { "idx": 121, "version": "7", + "when": 1759868882572, + "tag": "0121_aberrant_xavin", + "breakpoints": true + }, + { + "idx": 122, + "version": "7", "when": 1759938996590, - "tag": "0121_same_calypso", + "tag": "0122_same_calypso", "breakpoints": true } ]