From f6114a56af0d33a00cbd357067b23f876039a17a Mon Sep 17 00:00:00 2001 From: Henry <30578846+hjball@users.noreply.github.com> Date: Tue, 10 Jun 2025 21:15:47 +0100 Subject: [PATCH] chore: patch migration order (#74) --- .../20250610200449_ReaddIntegrationTable.sql | 17 + .../meta/20250608100932_snapshot.json | 437 +--- .../meta/20250608175448_snapshot.json | 422 +--- .../meta/20250610200449_snapshot.json | 2087 +++++++++++++++++ packages/db/migrations/meta/_journal.json | 9 +- 5 files changed, 2322 insertions(+), 650 deletions(-) create mode 100644 packages/db/migrations/20250610200449_ReaddIntegrationTable.sql create mode 100644 packages/db/migrations/meta/20250610200449_snapshot.json diff --git a/packages/db/migrations/20250610200449_ReaddIntegrationTable.sql b/packages/db/migrations/20250610200449_ReaddIntegrationTable.sql new file mode 100644 index 00000000..7b6ba42c --- /dev/null +++ b/packages/db/migrations/20250610200449_ReaddIntegrationTable.sql @@ -0,0 +1,17 @@ +CREATE TABLE IF NOT EXISTS "integration" ( + "provider" varchar(255) NOT NULL, + "userId" uuid NOT NULL, + "accessToken" varchar(255) NOT NULL, + "refreshToken" varchar(255), + "expiresAt" timestamp NOT NULL, + "createdAt" timestamp NOT NULL, + "updatedAt" timestamp, + CONSTRAINT "integration_pkey" PRIMARY KEY("userId","provider") +); +--> statement-breakpoint +ALTER TABLE "integration" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "integration" ADD CONSTRAINT "integration_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; \ No newline at end of file diff --git a/packages/db/migrations/meta/20250608100932_snapshot.json b/packages/db/migrations/meta/20250608100932_snapshot.json index fc4daccf..6193c4df 100644 --- a/packages/db/migrations/meta/20250608100932_snapshot.json +++ b/packages/db/migrations/meta/20250608100932_snapshot.json @@ -1,6 +1,6 @@ { "id": "d170c8e0-bf75-4c71-abd9-0ecbeeb14003", - "prevId": "1a07a776-0481-49f9-9098-02d530b37cf5", + "prevId": "058e8521-2814-46f0-a33f-1bbd86f450ce", "version": "7", "dialect": "postgresql", "tables": { @@ -93,12 +93,8 @@ "name": "account_userId_user_id_fk", "tableFrom": "account", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -246,12 +242,8 @@ "name": "apiKey_userId_user_id_fk", "tableFrom": "apiKey", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -321,12 +313,8 @@ "name": "session_userId_user_id_fk", "tableFrom": "session", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -336,9 +324,7 @@ "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, - "columns": [ - "token" - ] + "columns": ["token"] } }, "policies": {}, @@ -524,12 +510,8 @@ "name": "board_createdBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -537,12 +519,8 @@ "name": "board_deletedBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -550,12 +528,8 @@ "name": "board_importId_import_id_fk", "tableFrom": "board", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -563,12 +537,8 @@ "name": "board_workspaceId_workspace_id_fk", "tableFrom": "board", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -578,9 +548,7 @@ "board_publicId_unique": { "name": "board_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -714,12 +682,8 @@ "name": "card_activity_cardId_card_id_fk", "tableFrom": "card_activity", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -727,12 +691,8 @@ "name": "card_activity_fromListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["fromListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -740,12 +700,8 @@ "name": "card_activity_toListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["toListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -753,12 +709,8 @@ "name": "card_activity_labelId_label_id_fk", "tableFrom": "card_activity", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -766,12 +718,8 @@ "name": "card_activity_workspaceMemberId_workspace_members_id_fk", "tableFrom": "card_activity", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -779,12 +727,8 @@ "name": "card_activity_createdBy_user_id_fk", "tableFrom": "card_activity", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -792,12 +736,8 @@ "name": "card_activity_commentId_card_comments_id_fk", "tableFrom": "card_activity", "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["commentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -807,9 +747,7 @@ "card_activity_publicId_unique": { "name": "card_activity_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -839,12 +777,8 @@ "name": "_card_workspace_members_cardId_card_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -852,12 +786,8 @@ "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -865,10 +795,7 @@ "compositePrimaryKeys": { "_card_workspace_members_cardId_workspaceMemberId_pk": { "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] + "columns": ["cardId", "workspaceMemberId"] } }, "uniqueConstraints": {}, @@ -960,12 +887,8 @@ "name": "card_createdBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -973,12 +896,8 @@ "name": "card_deletedBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -986,12 +905,8 @@ "name": "card_listId_list_id_fk", "tableFrom": "card", "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["listId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -999,12 +914,8 @@ "name": "card_importId_import_id_fk", "tableFrom": "card", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1014,9 +925,7 @@ "card_publicId_unique": { "name": "card_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1046,12 +955,8 @@ "name": "_card_labels_cardId_card_id_fk", "tableFrom": "_card_labels", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1059,12 +964,8 @@ "name": "_card_labels_labelId_label_id_fk", "tableFrom": "_card_labels", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1072,10 +973,7 @@ "compositePrimaryKeys": { "_card_labels_cardId_labelId_pk": { "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] + "columns": ["cardId", "labelId"] } }, "uniqueConstraints": {}, @@ -1149,12 +1047,8 @@ "name": "card_comments_cardId_card_id_fk", "tableFrom": "card_comments", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1162,12 +1056,8 @@ "name": "card_comments_createdBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1175,12 +1065,8 @@ "name": "card_comments_deletedBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1190,9 +1076,7 @@ "card_comments_publicId_unique": { "name": "card_comments_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1254,12 +1138,8 @@ "name": "feedback_createdBy_user_id_fk", "tableFrom": "feedback", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1320,12 +1200,8 @@ "name": "import_createdBy_user_id_fk", "tableFrom": "import", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1335,9 +1211,7 @@ "import_publicId_unique": { "name": "import_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1422,12 +1296,8 @@ "name": "label_createdBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1435,12 +1305,8 @@ "name": "label_boardId_board_id_fk", "tableFrom": "label", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1448,12 +1314,8 @@ "name": "label_importId_import_id_fk", "tableFrom": "label", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1461,12 +1323,8 @@ "name": "label_deletedBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1476,9 +1334,7 @@ "label_publicId_unique": { "name": "label_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1563,12 +1419,8 @@ "name": "list_createdBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1576,12 +1428,8 @@ "name": "list_deletedBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1589,12 +1437,8 @@ "name": "list_boardId_board_id_fk", "tableFrom": "list", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1602,12 +1446,8 @@ "name": "list_importId_import_id_fk", "tableFrom": "list", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1617,9 +1457,7 @@ "list_publicId_unique": { "name": "list_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1689,9 +1527,7 @@ "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, - "columns": [ - "email" - ] + "columns": ["email"] } }, "policies": {}, @@ -1751,12 +1587,8 @@ "name": "integration_userId_user_id_fk", "tableFrom": "integration", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1764,10 +1596,7 @@ "compositePrimaryKeys": { "integration_pkey": { "name": "integration_pkey", - "columns": [ - "userId", - "provider" - ] + "columns": ["userId", "provider"] } }, "uniqueConstraints": {}, @@ -1800,9 +1629,7 @@ "workspace_slugs_slug_unique": { "name": "workspace_slugs_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -1896,12 +1723,8 @@ "name": "workspace_members_userId_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1909,12 +1732,8 @@ "name": "workspace_members_workspaceId_workspace_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1922,12 +1741,8 @@ "name": "workspace_members_deletedBy_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1937,9 +1752,7 @@ "workspace_members_publicId_unique": { "name": "workspace_members_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2026,12 +1839,8 @@ "name": "workspace_createdBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -2039,12 +1848,8 @@ "name": "workspace_deletedBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -2054,16 +1859,12 @@ "workspace_publicId_unique": { "name": "workspace_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_slug_unique": { "name": "workspace_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -2075,10 +1876,7 @@ "public.board_visibility": { "name": "board_visibility", "schema": "public", - "values": [ - "private", - "public" - ] + "values": ["private", "public"] }, "public.card_activity_type": { "name": "card_activity_type", @@ -2102,53 +1900,32 @@ "public.source": { "name": "source", "schema": "public", - "values": [ - "trello" - ] + "values": ["trello"] }, "public.status": { "name": "status", "schema": "public", - "values": [ - "started", - "success", - "failed" - ] + "values": ["started", "success", "failed"] }, "public.role": { "name": "role", "schema": "public", - "values": [ - "admin", - "member", - "guest" - ] + "values": ["admin", "member", "guest"] }, "public.member_status": { "name": "member_status", "schema": "public", - "values": [ - "invited", - "active", - "removed" - ] + "values": ["invited", "active", "removed"] }, "public.slug_type": { "name": "slug_type", "schema": "public", - "values": [ - "reserved", - "premium" - ] + "values": ["reserved", "premium"] }, "public.workspace_plan": { "name": "workspace_plan", "schema": "public", - "values": [ - "free", - "pro", - "enterprise" - ] + "values": ["free", "pro", "enterprise"] } }, "schemas": {}, @@ -2161,4 +1938,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/migrations/meta/20250608175448_snapshot.json b/packages/db/migrations/meta/20250608175448_snapshot.json index 5d40dc68..2f5d65ad 100644 --- a/packages/db/migrations/meta/20250608175448_snapshot.json +++ b/packages/db/migrations/meta/20250608175448_snapshot.json @@ -93,12 +93,8 @@ "name": "account_userId_user_id_fk", "tableFrom": "account", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -246,12 +242,8 @@ "name": "apiKey_userId_user_id_fk", "tableFrom": "apiKey", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -321,12 +313,8 @@ "name": "session_userId_user_id_fk", "tableFrom": "session", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -336,9 +324,7 @@ "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, - "columns": [ - "token" - ] + "columns": ["token"] } }, "policies": {}, @@ -524,12 +510,8 @@ "name": "board_createdBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -537,12 +519,8 @@ "name": "board_deletedBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -550,12 +528,8 @@ "name": "board_importId_import_id_fk", "tableFrom": "board", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -563,12 +537,8 @@ "name": "board_workspaceId_workspace_id_fk", "tableFrom": "board", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -578,9 +548,7 @@ "board_publicId_unique": { "name": "board_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -714,12 +682,8 @@ "name": "card_activity_cardId_card_id_fk", "tableFrom": "card_activity", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -727,12 +691,8 @@ "name": "card_activity_fromListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["fromListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -740,12 +700,8 @@ "name": "card_activity_toListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["toListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -753,12 +709,8 @@ "name": "card_activity_labelId_label_id_fk", "tableFrom": "card_activity", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -766,12 +718,8 @@ "name": "card_activity_workspaceMemberId_workspace_members_id_fk", "tableFrom": "card_activity", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -779,12 +727,8 @@ "name": "card_activity_createdBy_user_id_fk", "tableFrom": "card_activity", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -792,12 +736,8 @@ "name": "card_activity_commentId_card_comments_id_fk", "tableFrom": "card_activity", "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["commentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -807,9 +747,7 @@ "card_activity_publicId_unique": { "name": "card_activity_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -839,12 +777,8 @@ "name": "_card_workspace_members_cardId_card_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -852,12 +786,8 @@ "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -865,10 +795,7 @@ "compositePrimaryKeys": { "_card_workspace_members_cardId_workspaceMemberId_pk": { "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] + "columns": ["cardId", "workspaceMemberId"] } }, "uniqueConstraints": {}, @@ -960,12 +887,8 @@ "name": "card_createdBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -973,12 +896,8 @@ "name": "card_deletedBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -986,12 +905,8 @@ "name": "card_listId_list_id_fk", "tableFrom": "card", "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["listId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -999,12 +914,8 @@ "name": "card_importId_import_id_fk", "tableFrom": "card", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1014,9 +925,7 @@ "card_publicId_unique": { "name": "card_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1046,12 +955,8 @@ "name": "_card_labels_cardId_card_id_fk", "tableFrom": "_card_labels", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1059,12 +964,8 @@ "name": "_card_labels_labelId_label_id_fk", "tableFrom": "_card_labels", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1072,10 +973,7 @@ "compositePrimaryKeys": { "_card_labels_cardId_labelId_pk": { "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] + "columns": ["cardId", "labelId"] } }, "uniqueConstraints": {}, @@ -1149,12 +1047,8 @@ "name": "card_comments_cardId_card_id_fk", "tableFrom": "card_comments", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1162,12 +1056,8 @@ "name": "card_comments_createdBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1175,12 +1065,8 @@ "name": "card_comments_deletedBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1190,9 +1076,7 @@ "card_comments_publicId_unique": { "name": "card_comments_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1254,12 +1138,8 @@ "name": "feedback_createdBy_user_id_fk", "tableFrom": "feedback", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1320,12 +1200,8 @@ "name": "import_createdBy_user_id_fk", "tableFrom": "import", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1335,9 +1211,7 @@ "import_publicId_unique": { "name": "import_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1422,12 +1296,8 @@ "name": "label_createdBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1435,12 +1305,8 @@ "name": "label_boardId_board_id_fk", "tableFrom": "label", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1448,12 +1314,8 @@ "name": "label_importId_import_id_fk", "tableFrom": "label", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -1461,12 +1323,8 @@ "name": "label_deletedBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1476,9 +1334,7 @@ "label_publicId_unique": { "name": "label_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1563,12 +1419,8 @@ "name": "list_createdBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1576,12 +1428,8 @@ "name": "list_deletedBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1589,12 +1437,8 @@ "name": "list_boardId_board_id_fk", "tableFrom": "list", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1602,12 +1446,8 @@ "name": "list_importId_import_id_fk", "tableFrom": "list", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1617,9 +1457,7 @@ "list_publicId_unique": { "name": "list_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1689,9 +1527,7 @@ "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, - "columns": [ - "email" - ] + "columns": ["email"] } }, "policies": {}, @@ -1723,9 +1559,7 @@ "workspace_slugs_slug_unique": { "name": "workspace_slugs_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -1819,12 +1653,8 @@ "name": "workspace_members_userId_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1832,12 +1662,8 @@ "name": "workspace_members_workspaceId_workspace_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1845,12 +1671,8 @@ "name": "workspace_members_deletedBy_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1860,9 +1682,7 @@ "workspace_members_publicId_unique": { "name": "workspace_members_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1949,12 +1769,8 @@ "name": "workspace_createdBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1962,12 +1778,8 @@ "name": "workspace_deletedBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1977,16 +1789,12 @@ "workspace_publicId_unique": { "name": "workspace_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_slug_unique": { "name": "workspace_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -1998,10 +1806,7 @@ "public.board_visibility": { "name": "board_visibility", "schema": "public", - "values": [ - "private", - "public" - ] + "values": ["private", "public"] }, "public.card_activity_type": { "name": "card_activity_type", @@ -2025,53 +1830,32 @@ "public.source": { "name": "source", "schema": "public", - "values": [ - "trello" - ] + "values": ["trello"] }, "public.status": { "name": "status", "schema": "public", - "values": [ - "started", - "success", - "failed" - ] + "values": ["started", "success", "failed"] }, "public.role": { "name": "role", "schema": "public", - "values": [ - "admin", - "member", - "guest" - ] + "values": ["admin", "member", "guest"] }, "public.member_status": { "name": "member_status", "schema": "public", - "values": [ - "invited", - "active", - "removed" - ] + "values": ["invited", "active", "removed"] }, "public.slug_type": { "name": "slug_type", "schema": "public", - "values": [ - "reserved", - "premium" - ] + "values": ["reserved", "premium"] }, "public.workspace_plan": { "name": "workspace_plan", "schema": "public", - "values": [ - "free", - "pro", - "enterprise" - ] + "values": ["free", "pro", "enterprise"] } }, "schemas": {}, @@ -2084,4 +1868,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/migrations/meta/20250610200449_snapshot.json b/packages/db/migrations/meta/20250610200449_snapshot.json new file mode 100644 index 00000000..83039478 --- /dev/null +++ b/packages/db/migrations/meta/20250610200449_snapshot.json @@ -0,0 +1,2087 @@ +{ + "id": "91f9a2fa-31e2-4f3a-bdb9-852292fd7501", + "prevId": "058e8521-2814-46f0-a33f-1bbd86f450ce", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "accountId": { + "name": "accountId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "providerId": { + "name": "providerId", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "accessToken": { + "name": "accessToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refreshToken": { + "name": "refreshToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "idToken": { + "name": "idToken", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "accessTokenExpiresAt": { + "name": "accessTokenExpiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refreshTokenExpiresAt": { + "name": "refreshTokenExpiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "account_userId_user_id_fk": { + "name": "account_userId_user_id_fk", + "tableFrom": "account", + "columnsFrom": [ + "userId" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.apiKey": { + "name": "apiKey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "refillInterval": { + "name": "refillInterval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "refillAmount": { + "name": "refillAmount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lastRefillAt": { + "name": "lastRefillAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "rateLimitEnabled": { + "name": "rateLimitEnabled", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "rateLimitTimeWindow": { + "name": "rateLimitTimeWindow", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rateLimitMax": { + "name": "rateLimitMax", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "requestCount": { + "name": "requestCount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lastRequest": { + "name": "lastRequest", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expiresAt": { + "name": "expiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "apiKey_userId_user_id_fk": { + "name": "apiKey_userId_user_id_fk", + "tableFrom": "apiKey", + "columnsFrom": [ + "userId" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "expiresAt": { + "name": "expiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "userAgent": { + "name": "userAgent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "session_userId_user_id_fk": { + "name": "session_userId_user_id_fk", + "tableFrom": "session", + "columnsFrom": [ + "userId" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "columns": [ + "token" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expiresAt": { + "name": "expiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.board": { + "name": "board", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "board_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'private'" + } + }, + "indexes": { + "board_visibility_idx": { + "name": "board_visibility_idx", + "columns": [ + { + "expression": "visibility", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "with": {}, + "method": "btree", + "concurrently": false + }, + "unique_slug_per_workspace": { + "name": "unique_slug_per_workspace", + "columns": [ + { + "expression": "workspaceId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "slug", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "with": {}, + "method": "btree", + "where": "\"board\".\"deletedAt\" IS NULL", + "concurrently": false + } + }, + "foreignKeys": { + "board_createdBy_user_id_fk": { + "name": "board_createdBy_user_id_fk", + "tableFrom": "board", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "board_deletedBy_user_id_fk": { + "name": "board_deletedBy_user_id_fk", + "tableFrom": "board", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "board_importId_import_id_fk": { + "name": "board_importId_import_id_fk", + "tableFrom": "board", + "columnsFrom": [ + "importId" + ], + "tableTo": "import", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "board_workspaceId_workspace_id_fk": { + "name": "board_workspaceId_workspace_id_fk", + "tableFrom": "board", + "columnsFrom": [ + "workspaceId" + ], + "tableTo": "workspace", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "board_publicId_unique": { + "name": "board_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card_activity": { + "name": "card_activity", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "card_activity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "fromIndex": { + "name": "fromIndex", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "toIndex": { + "name": "toIndex", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "fromListId": { + "name": "fromListId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "toListId": { + "name": "toListId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "labelId": { + "name": "labelId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "workspaceMemberId": { + "name": "workspaceMemberId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "fromTitle": { + "name": "fromTitle", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "toTitle": { + "name": "toTitle", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "fromDescription": { + "name": "fromDescription", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "toDescription": { + "name": "toDescription", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "commentId": { + "name": "commentId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "fromComment": { + "name": "fromComment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "toComment": { + "name": "toComment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_activity_cardId_card_id_fk": { + "name": "card_activity_cardId_card_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "cardId" + ], + "tableTo": "card", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_activity_fromListId_list_id_fk": { + "name": "card_activity_fromListId_list_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "fromListId" + ], + "tableTo": "list", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_activity_toListId_list_id_fk": { + "name": "card_activity_toListId_list_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "toListId" + ], + "tableTo": "list", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_activity_labelId_label_id_fk": { + "name": "card_activity_labelId_label_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "labelId" + ], + "tableTo": "label", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_activity_workspaceMemberId_workspace_members_id_fk": { + "name": "card_activity_workspaceMemberId_workspace_members_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "workspaceMemberId" + ], + "tableTo": "workspace_members", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "card_activity_createdBy_user_id_fk": { + "name": "card_activity_createdBy_user_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "card_activity_commentId_card_comments_id_fk": { + "name": "card_activity_commentId_card_comments_id_fk", + "tableFrom": "card_activity", + "columnsFrom": [ + "commentId" + ], + "tableTo": "card_comments", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_activity_publicId_unique": { + "name": "card_activity_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public._card_workspace_members": { + "name": "_card_workspace_members", + "schema": "", + "columns": { + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "workspaceMemberId": { + "name": "workspaceMemberId", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "_card_workspace_members_cardId_card_id_fk": { + "name": "_card_workspace_members_cardId_card_id_fk", + "tableFrom": "_card_workspace_members", + "columnsFrom": [ + "cardId" + ], + "tableTo": "card", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { + "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", + "tableFrom": "_card_workspace_members", + "columnsFrom": [ + "workspaceMemberId" + ], + "tableTo": "workspace_members", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "_card_workspace_members_cardId_workspaceMemberId_pk": { + "name": "_card_workspace_members_cardId_workspaceMemberId_pk", + "columns": [ + "cardId", + "workspaceMemberId" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card": { + "name": "card", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "index": { + "name": "index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "listId": { + "name": "listId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_createdBy_user_id_fk": { + "name": "card_createdBy_user_id_fk", + "tableFrom": "card", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "card_deletedBy_user_id_fk": { + "name": "card_deletedBy_user_id_fk", + "tableFrom": "card", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "card_listId_list_id_fk": { + "name": "card_listId_list_id_fk", + "tableFrom": "card", + "columnsFrom": [ + "listId" + ], + "tableTo": "list", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_importId_import_id_fk": { + "name": "card_importId_import_id_fk", + "tableFrom": "card", + "columnsFrom": [ + "importId" + ], + "tableTo": "import", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_publicId_unique": { + "name": "card_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public._card_labels": { + "name": "_card_labels", + "schema": "", + "columns": { + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "labelId": { + "name": "labelId", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "_card_labels_cardId_card_id_fk": { + "name": "_card_labels_cardId_card_id_fk", + "tableFrom": "_card_labels", + "columnsFrom": [ + "cardId" + ], + "tableTo": "card", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "_card_labels_labelId_label_id_fk": { + "name": "_card_labels_labelId_label_id_fk", + "tableFrom": "_card_labels", + "columnsFrom": [ + "labelId" + ], + "tableTo": "label", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + } + }, + "compositePrimaryKeys": { + "_card_labels_cardId_labelId_pk": { + "name": "_card_labels_cardId_labelId_pk", + "columns": [ + "cardId", + "labelId" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card_comments": { + "name": "card_comments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_comments_cardId_card_id_fk": { + "name": "card_comments_cardId_card_id_fk", + "tableFrom": "card_comments", + "columnsFrom": [ + "cardId" + ], + "tableTo": "card", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "card_comments_createdBy_user_id_fk": { + "name": "card_comments_createdBy_user_id_fk", + "tableFrom": "card_comments", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "card_comments_deletedBy_user_id_fk": { + "name": "card_comments_deletedBy_user_id_fk", + "tableFrom": "card_comments", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_comments_publicId_unique": { + "name": "card_comments_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.feedback": { + "name": "feedback", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "feedback": { + "name": "feedback", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reviewed": { + "name": "reviewed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "feedback_createdBy_user_id_fk": { + "name": "feedback_createdBy_user_id_fk", + "tableFrom": "feedback", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.import": { + "name": "import", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "import_createdBy_user_id_fk": { + "name": "import_createdBy_user_id_fk", + "tableFrom": "import", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "import_publicId_unique": { + "name": "import_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.label": { + "name": "label", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "colourCode": { + "name": "colourCode", + "type": "varchar(12)", + "primaryKey": false, + "notNull": false + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "boardId": { + "name": "boardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "label_createdBy_user_id_fk": { + "name": "label_createdBy_user_id_fk", + "tableFrom": "label", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "label_boardId_board_id_fk": { + "name": "label_boardId_board_id_fk", + "tableFrom": "label", + "columnsFrom": [ + "boardId" + ], + "tableTo": "board", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "label_importId_import_id_fk": { + "name": "label_importId_import_id_fk", + "tableFrom": "label", + "columnsFrom": [ + "importId" + ], + "tableTo": "import", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + }, + "label_deletedBy_user_id_fk": { + "name": "label_deletedBy_user_id_fk", + "tableFrom": "label", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "label_publicId_unique": { + "name": "label_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.list": { + "name": "list", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "index": { + "name": "index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "boardId": { + "name": "boardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "list_createdBy_user_id_fk": { + "name": "list_createdBy_user_id_fk", + "tableFrom": "list", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "list_deletedBy_user_id_fk": { + "name": "list_deletedBy_user_id_fk", + "tableFrom": "list", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "list_boardId_board_id_fk": { + "name": "list_boardId_board_id_fk", + "tableFrom": "list", + "columnsFrom": [ + "boardId" + ], + "tableTo": "board", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "list_importId_import_id_fk": { + "name": "list_importId_import_id_fk", + "tableFrom": "list", + "columnsFrom": [ + "importId" + ], + "tableTo": "import", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "list_publicId_unique": { + "name": "list_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "uuid_generate_v4()" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "emailVerified": { + "name": "emailVerified", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "stripeCustomerId": { + "name": "stripeCustomerId", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "columns": [ + "email" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_slugs": { + "name": "workspace_slugs", + "schema": "", + "columns": { + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "slug_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_slugs_slug_unique": { + "name": "workspace_slugs_slug_unique", + "columns": [ + "slug" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_members": { + "name": "workspace_members", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "member_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'invited'" + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_members_userId_user_id_fk": { + "name": "workspace_members_userId_user_id_fk", + "tableFrom": "workspace_members", + "columnsFrom": [ + "userId" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "workspace_members_workspaceId_workspace_id_fk": { + "name": "workspace_members_workspaceId_workspace_id_fk", + "tableFrom": "workspace_members", + "columnsFrom": [ + "workspaceId" + ], + "tableTo": "workspace", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "cascade" + }, + "workspace_members_deletedBy_user_id_fk": { + "name": "workspace_members_deletedBy_user_id_fk", + "tableFrom": "workspace_members", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_members_publicId_unique": { + "name": "workspace_members_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace": { + "name": "workspace", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "plan": { + "name": "plan", + "type": "workspace_plan", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'free'" + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_createdBy_user_id_fk": { + "name": "workspace_createdBy_user_id_fk", + "tableFrom": "workspace", + "columnsFrom": [ + "createdBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + }, + "workspace_deletedBy_user_id_fk": { + "name": "workspace_deletedBy_user_id_fk", + "tableFrom": "workspace", + "columnsFrom": [ + "deletedBy" + ], + "tableTo": "user", + "columnsTo": [ + "id" + ], + "onUpdate": "no action", + "onDelete": "set null" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_publicId_unique": { + "name": "workspace_publicId_unique", + "columns": [ + "publicId" + ], + "nullsNotDistinct": false + }, + "workspace_slug_unique": { + "name": "workspace_slug_unique", + "columns": [ + "slug" + ], + "nullsNotDistinct": false + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + } + }, + "enums": { + "public.board_visibility": { + "name": "board_visibility", + "schema": "public", + "values": [ + "private", + "public" + ] + }, + "public.card_activity_type": { + "name": "card_activity_type", + "schema": "public", + "values": [ + "card.created", + "card.updated.title", + "card.updated.description", + "card.updated.index", + "card.updated.list", + "card.updated.label.added", + "card.updated.label.removed", + "card.updated.member.added", + "card.updated.member.removed", + "card.updated.comment.added", + "card.updated.comment.updated", + "card.updated.comment.deleted", + "card.archived" + ] + }, + "public.source": { + "name": "source", + "schema": "public", + "values": [ + "trello" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "started", + "success", + "failed" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "admin", + "member", + "guest" + ] + }, + "public.member_status": { + "name": "member_status", + "schema": "public", + "values": [ + "invited", + "active", + "removed" + ] + }, + "public.slug_type": { + "name": "slug_type", + "schema": "public", + "values": [ + "reserved", + "premium" + ] + }, + "public.workspace_plan": { + "name": "workspace_plan", + "schema": "public", + "values": [ + "free", + "pro", + "enterprise" + ] + } + }, + "schemas": {}, + "views": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 40214ec2..9aa17e65 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -43,6 +43,13 @@ "when": 1749377372062, "tag": "20250608100932_AddIntegrationsTable", "breakpoints": true + }, + { + "idx": 6, + "version": "7", + "when": 1749585889984, + "tag": "20250610200449_ReaddIntegrationTable", + "breakpoints": true } ] -} \ No newline at end of file +}