diff --git a/src/drizzle/0014_app-data-indexes.sql b/src/drizzle/0014_app-data-indexes.sql new file mode 100644 index 0000000000..737f6ab47d --- /dev/null +++ b/src/drizzle/0014_app-data-indexes.sql @@ -0,0 +1,2 @@ +CREATE INDEX "IDX_app_data_item_id" ON "app_data" USING btree ("item_id" uuid_ops);--> statement-breakpoint +CREATE INDEX "IDX_app_data_account_id" ON "app_data" USING btree ("account_id" uuid_ops);--> statement-breakpoint \ No newline at end of file diff --git a/src/drizzle/meta/0014_snapshot.json b/src/drizzle/meta/0014_snapshot.json new file mode 100644 index 0000000000..e565044833 --- /dev/null +++ b/src/drizzle/meta/0014_snapshot.json @@ -0,0 +1,3997 @@ +{ + "id": "00fa4907-bdb9-4652-9ba0-d5b5e918f00d", + "prevId": "f74ed7e7-ef60-4f08-8d24-8aa25f8e419e", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(150)", + "primaryKey": false, + "notNull": false + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "type": { + "name": "type", + "type": "account_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'individual'" + }, + "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()" + }, + "user_agreements_date": { + "name": "user_agreements_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "enable_save_actions": { + "name": "enable_save_actions", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "last_authenticated_at": { + "name": "last_authenticated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_validated": { + "name": "is_validated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "item_login_schema_id": { + "name": "item_login_schema_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "IDX_account_type": { + "name": "IDX_account_type", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "enum_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_item_login_schema_id_item_login_schema_id_fk": { + "name": "account_item_login_schema_id_item_login_schema_id_fk", + "tableFrom": "account", + "tableTo": "item_login_schema", + "columnsFrom": [ + "item_login_schema_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_account_name_item_login_schema_id": { + "name": "UQ_account_name_item_login_schema_id", + "nullsNotDistinct": false, + "columns": [ + "name", + "item_login_schema_id" + ] + }, + "member_email_key1": { + "name": "member_email_key1", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": { + "CHK_account_is_validated": { + "name": "CHK_account_is_validated", + "value": "(is_validated IS NOT NULL) OR ((type)::text <> 'individual'::text)" + }, + "CHK_account_email": { + "name": "CHK_account_email", + "value": "(email IS NOT NULL) OR ((type)::text <> 'individual'::text)" + }, + "CHK_account_extra": { + "name": "CHK_account_extra", + "value": "(extra IS NOT NULL) OR ((type)::text <> 'individual'::text)" + }, + "CHK_account_enable_save_actions": { + "name": "CHK_account_enable_save_actions", + "value": "(enable_save_actions IS NOT NULL) OR ((type)::text <> 'individual'::text)" + } + }, + "isRLSEnabled": false + }, + "public.action_request_export": { + "name": "action_request_export", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": false + }, + "format": { + "name": "format", + "type": "action_request_export_format_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'json'" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_fea823c4374f507a68cf8f926a4": { + "name": "FK_fea823c4374f507a68cf8f926a4", + "tableFrom": "action_request_export", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "FK_bc85ef3298df8c7974b33081b47": { + "name": "FK_bc85ef3298df8c7974b33081b47", + "tableFrom": "action_request_export", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.action": { + "name": "action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "view": { + "name": "view", + "type": "action_view_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'unknown'" + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "geolocation": { + "name": "geolocation", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "account_id": { + "name": "account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "IDX_1214f6f4d832c402751617361c": { + "name": "IDX_1214f6f4d832c402751617361c", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_action_account_id": { + "name": "IDX_action_account_id", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_1214f6f4d832c402751617361c0": { + "name": "FK_1214f6f4d832c402751617361c0", + "tableFrom": "action", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_action_account_id": { + "name": "FK_action_account_id", + "tableFrom": "action", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.admins": { + "name": "admins", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "citext", + "primaryKey": false, + "notNull": true + }, + "hashed_password": { + "name": "hashed_password", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "confirmed_at": { + "name": "confirmed_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "admins_email_index": { + "name": "admins_email_index", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "admins_email_unique": { + "name": "admins_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.admins_tokens": { + "name": "admins_tokens", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "context": { + "name": "context", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "sent_to": { + "name": "sent_to", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "authenticated_at": { + "name": "authenticated_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "admins_tokens_user_id_index": { + "name": "admins_tokens_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "admins_tokens_user_id_admins_id_fk": { + "name": "admins_tokens_user_id_admins_id_fk", + "tableFrom": "admins_tokens", + "tableTo": "admins", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "admins_tokens_context_token_index": { + "name": "admins_tokens_context_token_index", + "nullsNotDistinct": false, + "columns": [ + "context", + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_action": { + "name": "app_action", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "account_id": { + "name": "account_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "type": { + "name": "type", + "type": "varchar(25)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_c415fc186dda51fa260d338d776": { + "name": "FK_c415fc186dda51fa260d338d776", + "tableFrom": "app_action", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_app_action_account_id": { + "name": "FK_app_action_account_id", + "tableFrom": "app_action", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_data": { + "name": "app_data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "account_id": { + "name": "account_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "type": { + "name": "type", + "type": "varchar(25)", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "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()" + } + }, + "indexes": { + "IDX_6079b3bb63c13f815f7dd8d8a2": { + "name": "IDX_6079b3bb63c13f815f7dd8d8a2", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_app_data_item_id": { + "name": "IDX_app_data_item_id", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_app_data_account_id": { + "name": "IDX_app_data_account_id", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_8c3e2463c67d9865658941c9e2d": { + "name": "FK_8c3e2463c67d9865658941c9e2d", + "tableFrom": "app_data", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_27cb180cb3f372e4cf55302644a": { + "name": "FK_27cb180cb3f372e4cf55302644a", + "tableFrom": "app_data", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_app_data_account_id": { + "name": "FK_app_data_account_id", + "tableFrom": "app_data", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_setting": { + "name": "app_setting", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "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()" + } + }, + "indexes": { + "IDX_61546c650608c1e68789c64915": { + "name": "IDX_61546c650608c1e68789c64915", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_f5922b885e2680beab8add96008": { + "name": "FK_f5922b885e2680beab8add96008", + "tableFrom": "app_setting", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_22d3d051ee6f94932c1373a3d09": { + "name": "FK_22d3d051ee6f94932c1373a3d09", + "tableFrom": "app_setting", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apps": { + "name": "apps", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "key": { + "name": "key", + "type": "uuid", + "primaryKey": false, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(250)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar(250)", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "varchar(250)", + "primaryKey": false, + "notNull": true + }, + "thumbnail": { + "name": "thumbnail", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "publisher_id": { + "name": "publisher_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()" + } + }, + "indexes": {}, + "foreignKeys": { + "apps_publisher_id_fk": { + "name": "apps_publisher_id_fk", + "tableFrom": "apps", + "tableTo": "publishers", + "columnsFrom": [ + "publisher_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "app_key_key": { + "name": "app_key_key", + "nullsNotDistinct": false, + "columns": [ + "key" + ] + }, + "UQ_f36adbb7b096ceeb6f3e80ad14c": { + "name": "UQ_f36adbb7b096ceeb6f3e80ad14c", + "nullsNotDistinct": false, + "columns": [ + "name" + ] + }, + "app_url_key": { + "name": "app_url_key", + "nullsNotDistinct": false, + "columns": [ + "url" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.category": { + "name": "category", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "category-name-type": { + "name": "category-name-type", + "nullsNotDistinct": false, + "columns": [ + "name", + "type" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_mention": { + "name": "chat_mention", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "message_id": { + "name": "message_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "account_id": { + "name": "account_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()" + }, + "status": { + "name": "status", + "type": "chat_mention_status_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'unread'" + } + }, + "indexes": {}, + "foreignKeys": { + "chat_mention_message_id_chat_message_id_fk": { + "name": "chat_mention_message_id_chat_message_id_fk", + "tableFrom": "chat_mention", + "tableTo": "chat_message", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "chat_mention_account_id_account_id_fk": { + "name": "chat_mention_account_id_account_id_fk", + "tableFrom": "chat_mention", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "FK_e5199951167b722215127651e7c": { + "name": "FK_e5199951167b722215127651e7c", + "tableFrom": "chat_mention", + "tableTo": "chat_message", + "columnsFrom": [ + "message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_chat_mention_account_id": { + "name": "FK_chat_mention_account_id", + "tableFrom": "chat_mention", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat_message": { + "name": "chat_message", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "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()" + }, + "body": { + "name": "body", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "FK_b31e627ea7a4787672e265a1579": { + "name": "FK_b31e627ea7a4787672e265a1579", + "tableFrom": "chat_message", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_71fdcb9038eca1b903102bdfd17": { + "name": "FK_71fdcb9038eca1b903102bdfd17", + "tableFrom": "chat_message", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.guest_password": { + "name": "guest_password", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "password": { + "name": "password", + "type": "varchar(100)", + "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()" + }, + "guest_id": { + "name": "guest_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "FK_guest_password_guest_id": { + "name": "FK_guest_password_guest_id", + "tableFrom": "guest_password", + "tableTo": "account", + "columnsFrom": [ + "guest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_guest_password_guest_id": { + "name": "UQ_guest_password_guest_id", + "nullsNotDistinct": false, + "columns": [ + "guest_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitation": { + "name": "invitation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "permission_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'read'" + }, + "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()" + } + }, + "indexes": {}, + "foreignKeys": { + "invitation_creator_id_account_id_fk": { + "name": "invitation_creator_id_account_id_fk", + "tableFrom": "invitation", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "invitation_item_path_item_path_fk": { + "name": "invitation_item_path_item_path_fk", + "tableFrom": "invitation", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "FK_7ad4a490d5b9f79a677827b641c": { + "name": "FK_7ad4a490d5b9f79a677827b641c", + "tableFrom": "invitation", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_dc1d92accde1c2fbb7e729e4dcc": { + "name": "FK_dc1d92accde1c2fbb7e729e4dcc", + "tableFrom": "invitation", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item-email": { + "name": "item-email", + "nullsNotDistinct": false, + "columns": [ + "item_path", + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_favorite": { + "name": "item_favorite", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "FK_a169d350392956511697f7e7d38": { + "name": "FK_a169d350392956511697f7e7d38", + "tableFrom": "item_favorite", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_10ea93bde287762010695378f94": { + "name": "FK_10ea93bde287762010695378f94", + "tableFrom": "item_favorite", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "favorite_key": { + "name": "favorite_key", + "nullsNotDistinct": false, + "columns": [ + "member_id", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_category": { + "name": "item_category", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "category_id": { + "name": "category_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_638552fc7d9a2035c2b53182d8a": { + "name": "FK_638552fc7d9a2035c2b53182d8a", + "tableFrom": "item_category", + "tableTo": "category", + "columnsFrom": [ + "category_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_9a34a079b5b24f4396462546d26": { + "name": "FK_9a34a079b5b24f4396462546d26", + "tableFrom": "item_category", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_5681d1785eea699e9cae8818fe0": { + "name": "FK_5681d1785eea699e9cae8818fe0", + "tableFrom": "item_category", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "category-item": { + "name": "category-item", + "nullsNotDistinct": false, + "columns": [ + "item_path", + "category_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_export_request": { + "name": "item_export_request", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "item_export_request_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "item_export_request_member_id_account_id_fk": { + "name": "item_export_request_member_id_account_id_fk", + "tableFrom": "item_export_request", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "item_export_request_item_id_item_id_fk": { + "name": "item_export_request_item_id_item_id_fk", + "tableFrom": "item_export_request", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_flag": { + "name": "item_flag", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_b04d0adf4b73d82537c92fa55ea": { + "name": "FK_b04d0adf4b73d82537c92fa55ea", + "tableFrom": "item_flag", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_bde9b9ab1da1483a71c9b916dd2": { + "name": "FK_bde9b9ab1da1483a71c9b916dd2", + "tableFrom": "item_flag", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item-flag-creator": { + "name": "item-flag-creator", + "nullsNotDistinct": false, + "columns": [ + "type", + "creator_id", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_geolocation": { + "name": "item_geolocation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "lat": { + "name": "lat", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "lng": { + "name": "lng", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "country": { + "name": "country", + "type": "varchar(4)", + "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()" + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "addressLabel": { + "name": "addressLabel", + "type": "varchar(300)", + "primaryKey": false, + "notNull": false + }, + "helperLabel": { + "name": "helperLabel", + "type": "varchar(300)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "FK_66d4b13df4e7765068c8268d719": { + "name": "FK_66d4b13df4e7765068c8268d719", + "tableFrom": "item_geolocation", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item_geolocation_unique_item": { + "name": "item_geolocation_unique_item", + "nullsNotDistinct": false, + "columns": [ + "item_path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_like": { + "name": "item_like", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_item_like_item": { + "name": "IDX_item_like_item", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_4a56eba1ce30dc93f118a51ff26": { + "name": "FK_4a56eba1ce30dc93f118a51ff26", + "tableFrom": "item_like", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_159827eb667d019dc71372d7463": { + "name": "FK_159827eb667d019dc71372d7463", + "tableFrom": "item_like", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "id": { + "name": "id", + "nullsNotDistinct": false, + "columns": [ + "creator_id", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_login_schema": { + "name": "item_login_schema", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "type": { + "name": "type", + "type": "item_login_schema_type", + "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()" + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "item_login_schema_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + } + }, + "indexes": {}, + "foreignKeys": { + "item_login_schema_item_path_item_path_fk": { + "name": "item_login_schema_item_path_item_path_fk", + "tableFrom": "item_login_schema", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item-login-schema": { + "name": "item-login-schema", + "nullsNotDistinct": false, + "columns": [ + "item_path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_membership": { + "name": "item_membership", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "permission": { + "name": "permission", + "type": "permission_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "account_id": { + "name": "account_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()" + } + }, + "indexes": { + "IDX_5ac5bdde333fca6bbeaf177ef9": { + "name": "IDX_5ac5bdde333fca6bbeaf177ef9", + "columns": [ + { + "expression": "permission", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "text_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_d935785e7ecc015ed3ca048ff0": { + "name": "IDX_d935785e7ecc015ed3ca048ff0", + "columns": [ + { + "expression": "item_path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_gist_item_membership_path": { + "name": "IDX_gist_item_membership_path", + "columns": [ + { + "expression": "item_path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "IDX_item_membership_account_id": { + "name": "IDX_item_membership_account_id", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_item_membership_account_id_permission": { + "name": "IDX_item_membership_account_id_permission", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + }, + { + "expression": "permission", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "item_membership_item_path_item_path_fk": { + "name": "item_membership_item_path_item_path_fk", + "tableFrom": "item_membership", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + }, + "item_membership_creator_id_account_id_fk": { + "name": "item_membership_creator_id_account_id_fk", + "tableFrom": "item_membership", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "item_membership_account_id_account_id_fk": { + "name": "item_membership_account_id_account_id_fk", + "tableFrom": "item_membership", + "tableTo": "account", + "columnsFrom": [ + "account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item_membership-item-member": { + "name": "item_membership-item-member", + "nullsNotDistinct": false, + "columns": [ + "item_path", + "account_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_tag": { + "name": "item_tag", + "schema": "", + "columns": { + "tag_id": { + "name": "tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_item_tag_item": { + "name": "IDX_item_tag_item", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_16ab8afb42f763f7cbaa4bff66a": { + "name": "FK_16ab8afb42f763f7cbaa4bff66a", + "tableFrom": "item_tag", + "tableTo": "tag", + "columnsFrom": [ + "tag_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_39b492fda03c7ac846afe164b58": { + "name": "FK_39b492fda03c7ac846afe164b58", + "tableFrom": "item_tag", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "PK_a04bb2298e37d95233a0c92347e": { + "name": "PK_a04bb2298e37d95233a0c92347e", + "columns": [ + "tag_id", + "item_id" + ] + } + }, + "uniqueConstraints": { + "UQ_item_tag": { + "name": "UQ_item_tag", + "nullsNotDistinct": false, + "columns": [ + "tag_id", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_validation_group": { + "name": "item_validation_group", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_a9e83cf5f53c026b774b53d3c60": { + "name": "FK_a9e83cf5f53c026b774b53d3c60", + "tableFrom": "item_validation_group", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_validation_review": { + "name": "item_validation_review", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_validation_id": { + "name": "item_validation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "reviewer_id": { + "name": "reviewer_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "reason": { + "name": "reason", + "type": "varchar", + "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()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_59fd000835c70c728e525d82950": { + "name": "FK_59fd000835c70c728e525d82950", + "tableFrom": "item_validation_review", + "tableTo": "item_validation", + "columnsFrom": [ + "item_validation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_44bf14fee580ae08702d70e622e": { + "name": "FK_44bf14fee580ae08702d70e622e", + "tableFrom": "item_validation_review", + "tableTo": "account", + "columnsFrom": [ + "reviewer_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_validation": { + "name": "item_validation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "process": { + "name": "process", + "type": "item_validation_process", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "item_validation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "result": { + "name": "result", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "item_validation_group_id": { + "name": "item_validation_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()" + } + }, + "indexes": {}, + "foreignKeys": { + "FK_d60969d5e478e7c844532ac4e7f": { + "name": "FK_d60969d5e478e7c844532ac4e7f", + "tableFrom": "item_validation", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_e92da280941f666acf87baedc65": { + "name": "FK_e92da280941f666acf87baedc65", + "tableFrom": "item_validation", + "tableTo": "item_validation_group", + "columnsFrom": [ + "item_validation_group_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item_visibility": { + "name": "item_visibility", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "type": { + "name": "type", + "type": "item_visibility_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "IDX_gist_item_visibility_path": { + "name": "IDX_gist_item_visibility_path", + "columns": [ + { + "expression": "item_path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "FK_item_visibility_creator": { + "name": "FK_item_visibility_creator", + "tableFrom": "item_visibility", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_item_visibility_item": { + "name": "FK_item_visibility_item", + "tableFrom": "item_visibility", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_item_visibility_item_type": { + "name": "UQ_item_visibility_item_type", + "nullsNotDistinct": false, + "columns": [ + "type", + "item_path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.item": { + "name": "item", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'folder'" + }, + "description": { + "name": "description", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "settings": { + "name": "settings", + "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()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "lang": { + "name": "lang", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'en'" + }, + "order": { + "name": "order", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "IDX_bdc46717fadc2f04f3093e51fd": { + "name": "IDX_bdc46717fadc2f04f3093e51fd", + "columns": [ + { + "expression": "creator_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "IDX_gist_item_path": { + "name": "IDX_gist_item_path", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + }, + "IDX_gist_item_path_deleted_at": { + "name": "IDX_gist_item_path_deleted_at", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "where": "\"item\".\"deleted_at\" is null", + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "FK_bdc46717fadc2f04f3093e51fd5": { + "name": "FK_bdc46717fadc2f04f3093e51fd5", + "tableFrom": "item", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "item_path_key1": { + "name": "item_path_key1", + "nullsNotDistinct": false, + "columns": [ + "path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.maintenance": { + "name": "maintenance", + "schema": "", + "columns": { + "slug": { + "name": "slug", + "type": "varchar(100)", + "primaryKey": true, + "notNull": true + }, + "start_at": { + "name": "start_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "end_at": { + "name": "end_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_maintenance_slug": { + "name": "UQ_maintenance_slug", + "nullsNotDistinct": false, + "columns": [ + "slug" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.member_password": { + "name": "member_password", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "password": { + "name": "password", + "type": "varchar(100)", + "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()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "member_password_member_id_account_id_fk": { + "name": "member_password_member_id_account_id_fk", + "tableFrom": "member_password", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "member-password": { + "name": "member-password", + "nullsNotDistinct": false, + "columns": [ + "member_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.member_profile": { + "name": "member_profile", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "bio": { + "name": "bio", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "facebookId": { + "name": "facebookId", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "linkedinId": { + "name": "linkedinId", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "twitterId": { + "name": "twitterId", + "type": "varchar(100)", + "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()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_91fa43bc5482dc6b00892baf01": { + "name": "IDX_91fa43bc5482dc6b00892baf01", + "columns": [ + { + "expression": "member_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "member_profile_member_id_account_id_fk": { + "name": "member_profile_member_id_account_id_fk", + "tableFrom": "member_profile", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "FK_91fa43bc5482dc6b00892baf016": { + "name": "FK_91fa43bc5482dc6b00892baf016", + "tableFrom": "member_profile", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "member-profile": { + "name": "member-profile", + "nullsNotDistinct": false, + "columns": [ + "member_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.membership_request": { + "name": "membership_request", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "member_id": { + "name": "member_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "FK_membership_request_member_id": { + "name": "FK_membership_request_member_id", + "tableFrom": "membership_request", + "tableTo": "account", + "columnsFrom": [ + "member_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "FK_membership_request_item_id": { + "name": "FK_membership_request_item_id", + "tableFrom": "membership_request", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_membership_request_item-member": { + "name": "UQ_membership_request_item-member", + "nullsNotDistinct": false, + "columns": [ + "member_id", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.page_update": { + "name": "page_update", + "schema": "", + "columns": { + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "update": { + "name": "update", + "type": "bytea", + "primaryKey": false, + "notNull": true + }, + "clock": { + "name": "clock", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_page_item_id": { + "name": "IDX_page_item_id", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_page_update_item_id": { + "name": "FK_page_update_item_id", + "tableFrom": "page_update", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.published_items": { + "name": "published_items", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "IDX_gist_item_published_path": { + "name": "IDX_gist_item_published_path", + "columns": [ + { + "expression": "item_path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "published_items_creator_id_account_id_fk": { + "name": "published_items_creator_id_account_id_fk", + "tableFrom": "published_items", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "published_items_item_path_item_path_fk": { + "name": "published_items_item_path_item_path_fk", + "tableFrom": "published_items", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "published-item": { + "name": "published-item", + "nullsNotDistinct": false, + "columns": [ + "item_path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.publishers": { + "name": "publishers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(250)", + "primaryKey": false, + "notNull": true + }, + "origins": { + "name": "origins", + "type": "text[]", + "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()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "publisher_name_key": { + "name": "publisher_name_key", + "nullsNotDistinct": false, + "columns": [ + "name" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recycled_item_data": { + "name": "recycled_item_data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "item_path": { + "name": "item_path", + "type": "ltree", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_recycled_item_data_item_path": { + "name": "IDX_recycled_item_data_item_path", + "columns": [ + { + "expression": "item_path", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "gist_ltree_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gist", + "with": {} + } + }, + "foreignKeys": { + "FK_3e3650ebd5c49843013429d510a": { + "name": "FK_3e3650ebd5c49843013429d510a", + "tableFrom": "recycled_item_data", + "tableTo": "account", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "FK_f8a4db4476e3d81e18de5d63c42": { + "name": "FK_f8a4db4476e3d81e18de5d63c42", + "tableFrom": "recycled_item_data", + "tableTo": "item", + "columnsFrom": [ + "item_path" + ], + "columnsTo": [ + "path" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "recycled-item-data": { + "name": "recycled-item-data", + "nullsNotDistinct": false, + "columns": [ + "item_path" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.publication_removal_notices": { + "name": "publication_removal_notices", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "publication_name": { + "name": "publication_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "publication_removal_notices_item_id_index": { + "name": "publication_removal_notices_item_id_index", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "publication_removal_notices_item_id_item_id_fk": { + "name": "publication_removal_notices_item_id_item_id_fk", + "tableFrom": "publication_removal_notices", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "publication_removal_notices_creator_id_admins_id_fk": { + "name": "publication_removal_notices_creator_id_admins_id_fk", + "tableFrom": "publication_removal_notices", + "tableTo": "admins", + "columnsFrom": [ + "creator_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.schema_migrations": { + "name": "schema_migrations", + "schema": "", + "columns": { + "version": { + "name": "version", + "type": "bigint", + "primaryKey": true, + "notNull": true + }, + "inserted_at": { + "name": "inserted_at", + "type": "timestamp (0)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.short_link": { + "name": "short_link", + "schema": "", + "columns": { + "alias": { + "name": "alias", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "platform": { + "name": "platform", + "type": "short_link_platform_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "item_id": { + "name": "item_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "IDX_43c8a0471d5e58f99fc9c36b99": { + "name": "IDX_43c8a0471d5e58f99fc9c36b99", + "columns": [ + { + "expression": "item_id", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "uuid_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "FK_43c8a0471d5e58f99fc9c36b991": { + "name": "FK_43c8a0471d5e58f99fc9c36b991", + "tableFrom": "short_link", + "tableTo": "item", + "columnsFrom": [ + "item_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_859a3384cadaa460b84e04e5375": { + "name": "UQ_859a3384cadaa460b84e04e5375", + "nullsNotDistinct": false, + "columns": [ + "platform", + "item_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "CHK_200ef28b2168aaf1e36b6896fc": { + "name": "CHK_200ef28b2168aaf1e36b6896fc", + "value": "(length((alias)::text) >= 6) AND (length((alias)::text) <= 255) AND ((alias)::text ~ '^[a-zA-Z0-9-]*$'::text)" + } + }, + "isRLSEnabled": false + }, + "public.tag": { + "name": "tag", + "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 + }, + "category": { + "name": "category", + "type": "tag_category_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "UQ_tag_name_category": { + "name": "UQ_tag_name_category", + "nullsNotDistinct": false, + "columns": [ + "name", + "category" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.account_type_enum": { + "name": "account_type_enum", + "schema": "public", + "values": [ + "individual", + "guest" + ] + }, + "public.action_request_export_format_enum": { + "name": "action_request_export_format_enum", + "schema": "public", + "values": [ + "json", + "csv" + ] + }, + "public.action_view_enum": { + "name": "action_view_enum", + "schema": "public", + "values": [ + "builder", + "player", + "library", + "account", + "analytics", + "home", + "auth", + "unknown" + ] + }, + "public.chat_mention_status_enum": { + "name": "chat_mention_status_enum", + "schema": "public", + "values": [ + "unread", + "read" + ] + }, + "public.item_export_request_type_enum": { + "name": "item_export_request_type_enum", + "schema": "public", + "values": [ + "raw", + "graasp" + ] + }, + "public.item_login_schema_status": { + "name": "item_login_schema_status", + "schema": "public", + "values": [ + "active", + "freeze", + "disabled" + ] + }, + "public.item_login_schema_type": { + "name": "item_login_schema_type", + "schema": "public", + "values": [ + "username", + "username+password", + "anonymous", + "anonymous+password" + ] + }, + "public.item_validation_process": { + "name": "item_validation_process", + "schema": "public", + "values": [ + "bad-words-detection", + "image-classification" + ] + }, + "public.item_validation_status": { + "name": "item_validation_status", + "schema": "public", + "values": [ + "success", + "failure", + "pending", + "pending-manual" + ] + }, + "public.item_visibility_type": { + "name": "item_visibility_type", + "schema": "public", + "values": [ + "public", + "hidden" + ] + }, + "public.permission_enum": { + "name": "permission_enum", + "schema": "public", + "values": [ + "read", + "write", + "admin" + ] + }, + "public.short_link_platform_enum": { + "name": "short_link_platform_enum", + "schema": "public", + "values": [ + "builder", + "player", + "library" + ] + }, + "public.tag_category_enum": { + "name": "tag_category_enum", + "schema": "public", + "values": [ + "level", + "discipline", + "resource-type" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.guests_view": { + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "type": { + "name": "type", + "type": "account_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'individual'" + }, + "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()" + }, + "last_authenticated_at": { + "name": "last_authenticated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_validated": { + "name": "is_validated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "item_login_schema_id": { + "name": "item_login_schema_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "definition": "select \"id\", \"name\", \"extra\", \"type\", \"created_at\", \"updated_at\", \"last_authenticated_at\", \"is_validated\", \"item_login_schema_id\" from \"account\" where (\"account\".\"type\" = 'guest' and \"account\".\"item_login_schema_id\" is not null)", + "name": "guests_view", + "schema": "public", + "isExisting": false, + "materialized": false + }, + "public.item_view": { + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'folder'" + }, + "description": { + "name": "description", + "type": "varchar(5000)", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "ltree", + "primaryKey": false, + "notNull": true + }, + "creator_id": { + "name": "creator_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "settings": { + "name": "settings", + "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()" + }, + "lang": { + "name": "lang", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'en'" + }, + "order": { + "name": "order", + "type": "numeric", + "primaryKey": false, + "notNull": false + } + }, + "definition": "select \"id\", \"name\", \"type\", \"description\", \"path\", \"creator_id\", \"extra\", \"settings\", \"created_at\", \"updated_at\", \"lang\", \"order\" from \"item\" where \"item\".\"deleted_at\" is null", + "name": "item_view", + "schema": "public", + "isExisting": false, + "materialized": false + }, + "public.members_view": { + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(150)", + "primaryKey": false, + "notNull": false + }, + "extra": { + "name": "extra", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "type": { + "name": "type", + "type": "account_type_enum", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'individual'" + }, + "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()" + }, + "user_agreements_date": { + "name": "user_agreements_date", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "enable_save_actions": { + "name": "enable_save_actions", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "last_authenticated_at": { + "name": "last_authenticated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_validated": { + "name": "is_validated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "definition": "select \"id\", \"name\", \"email\", \"extra\", \"type\", \"created_at\", \"updated_at\", \"user_agreements_date\", \"enable_save_actions\", \"last_authenticated_at\", \"is_validated\" from \"account\" where (\"account\".\"type\" = 'individual' and \"account\".\"email\" is not null)", + "name": "members_view", + "schema": "public", + "isExisting": false, + "materialized": false + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/drizzle/meta/_journal.json b/src/drizzle/meta/_journal.json index e6098ec932..015dd7ed98 100644 --- a/src/drizzle/meta/_journal.json +++ b/src/drizzle/meta/_journal.json @@ -99,6 +99,13 @@ "when": 1760626541452, "tag": "0013_add-planned-maintenance-phoenix", "breakpoints": true + }, + { + "idx": 14, + "version": "7", + "when": 1761050515292, + "tag": "0014_app-data-indexes", + "breakpoints": true } ] -} \ No newline at end of file +} diff --git a/src/drizzle/schema.ts b/src/drizzle/schema.ts index 31c12b4013..183eceaf5d 100644 --- a/src/drizzle/schema.ts +++ b/src/drizzle/schema.ts @@ -398,6 +398,11 @@ export const appDataTable = pgTable( 'btree', table.type.asc().nullsLast().op('text_ops'), ), + index('IDX_app_data_item_id').using('btree', table.itemId.asc().nullsLast().op('uuid_ops')), + index('IDX_app_data_account_id').using( + 'btree', + table.accountId.asc().nullsLast().op('uuid_ops'), + ), foreignKey({ columns: [table.itemId], foreignColumns: [itemsRawTable.id],