From 66de4b6c42718be9540aa131184a1d1c91a8322a Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 15 May 2025 21:53:33 +0100 Subject: [PATCH] chore: flatten migrations --- packages/db/drizzle.config.ts | 3 + .../db/migrations/0001_little_red_hulk.sql | 1 - .../db/migrations/0002_bored_retro_girl.sql | 2 - packages/db/migrations/0003_fine_bedlam.sql | 1 - .../migrations/0004_eminent_living_mummy.sql | 12 - packages/db/migrations/0005_modern_gideon.sql | 3 - packages/db/migrations/0006_spicy_mach_iv.sql | 15 - .../migrations/0007_redundant_silver_fox.sql | 2 - .../db/migrations/0008_mature_ravenous.sql | 347 --- .../migrations/0009_shallow_silver_surfer.sql | 37 - .../db/migrations/0010_wet_true_believers.sql | 87 - .../db/migrations/0011_cultured_red_skull.sql | 8 - ...arr.sql => 20250508083758_SetupTables.sql} | 145 +- .../db/migrations/meta/0000_snapshot.json | 1485 ------------ .../db/migrations/meta/0001_snapshot.json | 1491 ------------ .../db/migrations/meta/0002_snapshot.json | 1508 ------------ .../db/migrations/meta/0003_snapshot.json | 1514 ------------ .../db/migrations/meta/0004_snapshot.json | 1548 ------------- .../db/migrations/meta/0005_snapshot.json | 1579 ------------- .../db/migrations/meta/0006_snapshot.json | 1650 ------------- .../db/migrations/meta/0007_snapshot.json | 1651 ------------- .../db/migrations/meta/0008_snapshot.json | 2004 ---------------- .../db/migrations/meta/0009_snapshot.json | 1651 ------------- .../db/migrations/meta/0010_snapshot.json | 2056 ----------------- ...shot.json => 20250508083758_snapshot.json} | 4 +- packages/db/migrations/meta/_journal.json | 81 +- 26 files changed, 143 insertions(+), 18742 deletions(-) delete mode 100644 packages/db/migrations/0001_little_red_hulk.sql delete mode 100644 packages/db/migrations/0002_bored_retro_girl.sql delete mode 100644 packages/db/migrations/0003_fine_bedlam.sql delete mode 100644 packages/db/migrations/0004_eminent_living_mummy.sql delete mode 100644 packages/db/migrations/0005_modern_gideon.sql delete mode 100644 packages/db/migrations/0006_spicy_mach_iv.sql delete mode 100644 packages/db/migrations/0007_redundant_silver_fox.sql delete mode 100644 packages/db/migrations/0008_mature_ravenous.sql delete mode 100644 packages/db/migrations/0009_shallow_silver_surfer.sql delete mode 100644 packages/db/migrations/0010_wet_true_believers.sql delete mode 100644 packages/db/migrations/0011_cultured_red_skull.sql rename packages/db/migrations/{0000_eager_krista_starr.sql => 20250508083758_SetupTables.sql} (74%) delete mode 100644 packages/db/migrations/meta/0000_snapshot.json delete mode 100644 packages/db/migrations/meta/0001_snapshot.json delete mode 100644 packages/db/migrations/meta/0002_snapshot.json delete mode 100644 packages/db/migrations/meta/0003_snapshot.json delete mode 100644 packages/db/migrations/meta/0004_snapshot.json delete mode 100644 packages/db/migrations/meta/0005_snapshot.json delete mode 100644 packages/db/migrations/meta/0006_snapshot.json delete mode 100644 packages/db/migrations/meta/0007_snapshot.json delete mode 100644 packages/db/migrations/meta/0008_snapshot.json delete mode 100644 packages/db/migrations/meta/0009_snapshot.json delete mode 100644 packages/db/migrations/meta/0010_snapshot.json rename packages/db/migrations/meta/{0011_snapshot.json => 20250508083758_snapshot.json} (99%) diff --git a/packages/db/drizzle.config.ts b/packages/db/drizzle.config.ts index 916dd339..24f9172b 100644 --- a/packages/db/drizzle.config.ts +++ b/packages/db/drizzle.config.ts @@ -14,5 +14,8 @@ export default { database: process.env.POSTGRES_DATABASE ?? "postgres", ssl: true, }, + migrations: { + prefix: "timestamp", + }, // tablesFilter: ["kan_*"], } satisfies Config; diff --git a/packages/db/migrations/0001_little_red_hulk.sql b/packages/db/migrations/0001_little_red_hulk.sql deleted file mode 100644 index 53be69c3..00000000 --- a/packages/db/migrations/0001_little_red_hulk.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "user" ADD COLUMN "stripeCustomerId" varchar(255); \ No newline at end of file diff --git a/packages/db/migrations/0002_bored_retro_girl.sql b/packages/db/migrations/0002_bored_retro_girl.sql deleted file mode 100644 index 28132261..00000000 --- a/packages/db/migrations/0002_bored_retro_girl.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE TYPE "public"."workspace_plan" AS ENUM('free', 'pro', 'enterprise');--> statement-breakpoint -ALTER TABLE "workspace" ADD COLUMN "plan" "workspace_plan" DEFAULT 'free' NOT NULL; \ No newline at end of file diff --git a/packages/db/migrations/0003_fine_bedlam.sql b/packages/db/migrations/0003_fine_bedlam.sql deleted file mode 100644 index 090a37f3..00000000 --- a/packages/db/migrations/0003_fine_bedlam.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE "workspace" ADD COLUMN "description" text; \ No newline at end of file diff --git a/packages/db/migrations/0004_eminent_living_mummy.sql b/packages/db/migrations/0004_eminent_living_mummy.sql deleted file mode 100644 index 7ca97a70..00000000 --- a/packages/db/migrations/0004_eminent_living_mummy.sql +++ /dev/null @@ -1,12 +0,0 @@ --- First add the columns without NOT NULL constraint -ALTER TABLE "board" ADD COLUMN "description" text;--> statement-breakpoint -ALTER TABLE "board" ADD COLUMN "slug" varchar(255);--> statement-breakpoint - --- Update existing records with a default slug (using board id to ensure uniqueness) -UPDATE "board" SET "slug" = 'board-' || id::text;--> statement-breakpoint - --- Now add the NOT NULL constraint -ALTER TABLE "board" ALTER COLUMN "slug" SET NOT NULL;--> statement-breakpoint - --- Finally create the unique index -CREATE UNIQUE INDEX IF NOT EXISTS "unique_slug_per_workspace" ON "board" USING btree ("workspaceId","slug"); \ No newline at end of file diff --git a/packages/db/migrations/0005_modern_gideon.sql b/packages/db/migrations/0005_modern_gideon.sql deleted file mode 100644 index 8623c46b..00000000 --- a/packages/db/migrations/0005_modern_gideon.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE TYPE "public"."board_visibility" AS ENUM('private', 'public');--> statement-breakpoint -ALTER TABLE "board" ADD COLUMN "visibility" "board_visibility" DEFAULT 'private' NOT NULL;--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "board_visibility_idx" ON "board" USING btree ("visibility"); \ No newline at end of file diff --git a/packages/db/migrations/0006_spicy_mach_iv.sql b/packages/db/migrations/0006_spicy_mach_iv.sql deleted file mode 100644 index 4b5524c2..00000000 --- a/packages/db/migrations/0006_spicy_mach_iv.sql +++ /dev/null @@ -1,15 +0,0 @@ -CREATE TABLE IF NOT EXISTS "feedback" ( - "id" bigserial PRIMARY KEY NOT NULL, - "feedback" text NOT NULL, - "createdBy" uuid NOT NULL, - "createdAt" timestamp DEFAULT now() NOT NULL, - "updatedAt" timestamp, - "url" text NOT NULL, - "reviewed" boolean DEFAULT false NOT NULL -); ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "feedback" ADD CONSTRAINT "feedback_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; -EXCEPTION - WHEN duplicate_object THEN null; -END $$; diff --git a/packages/db/migrations/0007_redundant_silver_fox.sql b/packages/db/migrations/0007_redundant_silver_fox.sql deleted file mode 100644 index e107149c..00000000 --- a/packages/db/migrations/0007_redundant_silver_fox.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP INDEX IF EXISTS "unique_slug_per_workspace";--> statement-breakpoint -CREATE UNIQUE INDEX IF NOT EXISTS "unique_slug_per_workspace" ON "board" USING btree ("workspaceId","slug") WHERE "board"."deletedAt" IS NULL; \ No newline at end of file diff --git a/packages/db/migrations/0008_mature_ravenous.sql b/packages/db/migrations/0008_mature_ravenous.sql deleted file mode 100644 index faa2dc95..00000000 --- a/packages/db/migrations/0008_mature_ravenous.sql +++ /dev/null @@ -1,347 +0,0 @@ -ALTER TABLE "board" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "card_activity" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "_card_workspace_members" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "card" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "_card_labels" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "card_comments" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "feedback" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "import" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "label" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "list" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "user" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "workspace_members" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "workspace" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -CREATE POLICY "Allow access to boards in user's workspace or public boards" ON "board" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - OR visibility = 'public' - );--> statement-breakpoint -CREATE POLICY "Allow inserting boards in user's workspace" ON "board" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating boards in user's workspace" ON "board" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting boards in user's workspace" ON "board" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to card activity in user's workspace or public boards" ON "card_activity" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting card activity in user's workspace" ON "card_activity" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to card workspace members in user's workspace" ON "_card_workspace_members" AS PERMISSIVE FOR ALL TO "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - AND - "workspaceMemberId" IN ( - SELECT wm.id - FROM workspace_members wm - WHERE wm."workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to cards in user's workspace or public boards" ON "card" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "listId" IN ( - SELECT l.id - FROM list l - JOIN board b ON l."boardId" = b.id - LEFT JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting cards in user's workspace" ON "card" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "listId" IN ( - SELECT l.id - FROM list l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating cards in user's workspace" ON "card" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "listId" IN ( - SELECT l.id - FROM list l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting cards in user's workspace" ON "card" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "listId" IN ( - SELECT l.id - FROM list l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to card labels in user's workspace or public boards" ON "_card_labels" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - LEFT JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" AND wm."userId" = auth.uid() - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - AND - "labelId" IN ( - SELECT l.id - FROM label l - JOIN board b ON l."boardId" = b.id - LEFT JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" AND wm."userId" = auth.uid() - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting card labels in user's workspace" ON "_card_labels" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - AND - "labelId" IN ( - SELECT l.id - FROM label l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating card labels in user's workspace" ON "_card_labels" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - AND - "labelId" IN ( - SELECT l.id - FROM label l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting card labels in user's workspace" ON "_card_labels" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - AND - "labelId" IN ( - SELECT l.id - FROM label l - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to card comments in user's workspace or public boards" ON "card_comments" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting comments on cards in user's workspace" ON "card_comments" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "cardId" IN ( - SELECT c.id - FROM card c - JOIN list l ON c."listId" = l.id - JOIN board b ON l."boardId" = b.id - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating own comments" ON "card_comments" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "createdBy" = auth.uid() - );--> statement-breakpoint -CREATE POLICY "Allow deleting own comments" ON "card_comments" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "createdBy" = auth.uid() - );--> statement-breakpoint -CREATE POLICY "Allow access to user's own imports" ON "import" AS PERMISSIVE FOR ALL TO "authenticated" USING ( - "createdBy" = auth.uid() - );--> statement-breakpoint -CREATE POLICY "Allow access to labels in user's workspace or public boards" ON "label" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - LEFT JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting labels in user's workspace" ON "label" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating labels in user's workspace" ON "label" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting labels in user's workspace" ON "label" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow access to lists in user's workspace or public boards" ON "list" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - LEFT JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - OR b.visibility = 'public' - ) - );--> statement-breakpoint -CREATE POLICY "Allow inserting lists in user's workspace" ON "list" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow updating lists in user's workspace" ON "list" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting lists in user's workspace" ON "list" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - "boardId" IN ( - SELECT b.id - FROM board b - JOIN workspace_members wm ON b."workspaceId" = wm."workspaceId" - WHERE wm."userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow viewing members in user's workspace" ON "user" AS PERMISSIVE FOR SELECT TO "authenticated" USING ( - id IN ( - SELECT wm."userId" - FROM workspace_members wm - WHERE wm."workspaceId" IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - ) - );--> statement-breakpoint -CREATE POLICY "Allow members to view workspace membership" ON "workspace_members" AS PERMISSIVE FOR SELECT TO "authenticated" USING ( - "userId" = auth.uid() OR - is_workspace_member(auth.uid(), "workspaceId") - );--> statement-breakpoint -CREATE POLICY "Allow admins to add workspace members" ON "workspace_members" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK ( - is_workspace_admin(auth.uid(), "workspaceId") - );--> statement-breakpoint -CREATE POLICY "Allow admins to update workspace members" ON "workspace_members" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - is_workspace_admin(auth.uid(), "workspaceId") - );--> statement-breakpoint -CREATE POLICY "Allow admins to remove workspace members" ON "workspace_members" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - is_workspace_admin(auth.uid(), "workspaceId") - );--> statement-breakpoint -CREATE POLICY "Allow viewing user's workspaces" ON "workspace" AS PERMISSIVE FOR SELECT TO "anon", "authenticated" USING ( - CASE - WHEN auth.uid() IS NULL THEN - EXISTS ( - SELECT 1 - FROM board - WHERE "workspaceId" = workspace.id - AND visibility = 'public' - ) - ELSE - id IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - OR "createdBy" = auth.uid() - END - );--> statement-breakpoint -CREATE POLICY "Allow updating user's workspaces" ON "workspace" AS PERMISSIVE FOR UPDATE TO "authenticated" USING ( - id IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow deleting user's workspaces" ON "workspace" AS PERMISSIVE FOR DELETE TO "authenticated" USING ( - id IN ( - SELECT "workspaceId" - FROM workspace_members - WHERE "userId" = auth.uid() - ) - );--> statement-breakpoint -CREATE POLICY "Allow authenticated users to create workspaces" ON "workspace" AS PERMISSIVE FOR INSERT TO "authenticated" WITH CHECK (true); \ No newline at end of file diff --git a/packages/db/migrations/0009_shallow_silver_surfer.sql b/packages/db/migrations/0009_shallow_silver_surfer.sql deleted file mode 100644 index 816afd83..00000000 --- a/packages/db/migrations/0009_shallow_silver_surfer.sql +++ /dev/null @@ -1,37 +0,0 @@ -DROP POLICY "Allow access to boards in user's workspace or public boards" ON "board" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting boards in user's workspace" ON "board" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating boards in user's workspace" ON "board" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting boards in user's workspace" ON "board" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to card activity in user's workspace or public boards" ON "card_activity" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting card activity in user's workspace" ON "card_activity" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to card workspace members in user's workspace" ON "_card_workspace_members" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to cards in user's workspace or public boards" ON "card" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting cards in user's workspace" ON "card" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating cards in user's workspace" ON "card" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting cards in user's workspace" ON "card" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to card labels in user's workspace or public boards" ON "_card_labels" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting card labels in user's workspace" ON "_card_labels" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating card labels in user's workspace" ON "_card_labels" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting card labels in user's workspace" ON "_card_labels" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to card comments in user's workspace or public boards" ON "card_comments" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting comments on cards in user's workspace" ON "card_comments" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating own comments" ON "card_comments" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting own comments" ON "card_comments" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to user's own imports" ON "import" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to labels in user's workspace or public boards" ON "label" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting labels in user's workspace" ON "label" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating labels in user's workspace" ON "label" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting labels in user's workspace" ON "label" CASCADE;--> statement-breakpoint -DROP POLICY "Allow access to lists in user's workspace or public boards" ON "list" CASCADE;--> statement-breakpoint -DROP POLICY "Allow inserting lists in user's workspace" ON "list" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating lists in user's workspace" ON "list" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting lists in user's workspace" ON "list" CASCADE;--> statement-breakpoint -DROP POLICY "Allow viewing members in user's workspace" ON "user" CASCADE;--> statement-breakpoint -DROP POLICY "Allow members to view workspace membership" ON "workspace_members" CASCADE;--> statement-breakpoint -DROP POLICY "Allow admins to add workspace members" ON "workspace_members" CASCADE;--> statement-breakpoint -DROP POLICY "Allow admins to update workspace members" ON "workspace_members" CASCADE;--> statement-breakpoint -DROP POLICY "Allow admins to remove workspace members" ON "workspace_members" CASCADE;--> statement-breakpoint -DROP POLICY "Allow viewing user's workspaces" ON "workspace" CASCADE;--> statement-breakpoint -DROP POLICY "Allow updating user's workspaces" ON "workspace" CASCADE;--> statement-breakpoint -DROP POLICY "Allow deleting user's workspaces" ON "workspace" CASCADE;--> statement-breakpoint -DROP POLICY "Allow authenticated users to create workspaces" ON "workspace" CASCADE; \ No newline at end of file diff --git a/packages/db/migrations/0010_wet_true_believers.sql b/packages/db/migrations/0010_wet_true_believers.sql deleted file mode 100644 index 5c06b1d7..00000000 --- a/packages/db/migrations/0010_wet_true_believers.sql +++ /dev/null @@ -1,87 +0,0 @@ -CREATE TABLE IF NOT EXISTS "account" ( - "id" bigserial PRIMARY KEY NOT NULL, - "accountId" text NOT NULL, - "providerId" text NOT NULL, - "userId" uuid NOT NULL, - "accessToken" text, - "refreshToken" text, - "idToken" text, - "accessTokenExpiresAt" timestamp, - "refreshTokenExpiresAt" timestamp, - "scope" text, - "password" text, - "createdAt" timestamp NOT NULL, - "updatedAt" timestamp NOT NULL -); ---> statement-breakpoint -ALTER TABLE "account" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -CREATE TABLE IF NOT EXISTS "apikey" ( - "id" bigserial PRIMARY KEY NOT NULL, - "name" text, - "start" text, - "prefix" text, - "key" text NOT NULL, - "userId" uuid NOT NULL, - "refillInterval" integer, - "refillAmount" integer, - "lastRefillAt" timestamp, - "enabled" boolean, - "rateLimitEnabled" boolean, - "rateLimitTimeWindow" integer, - "rateLimitMax" integer, - "requestCount" integer, - "remaining" integer, - "lastRequest" timestamp, - "expiresAt" timestamp, - "createdAt" timestamp NOT NULL, - "updatedAt" timestamp NOT NULL, - "permissions" text, - "metadata" text -); ---> statement-breakpoint -ALTER TABLE "apikey" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -CREATE TABLE IF NOT EXISTS "session" ( - "id" bigserial PRIMARY KEY NOT NULL, - "expiresAt" timestamp NOT NULL, - "token" text NOT NULL, - "createdAt" timestamp NOT NULL, - "updatedAt" timestamp NOT NULL, - "ipAddress" text, - "userAgent" text, - "userId" uuid NOT NULL, - CONSTRAINT "session_token_unique" UNIQUE("token") -); ---> statement-breakpoint -ALTER TABLE "session" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -CREATE TABLE IF NOT EXISTS "verification" ( - "id" bigserial PRIMARY KEY NOT NULL, - "identifier" text NOT NULL, - "value" text NOT NULL, - "expiresAt" timestamp NOT NULL, - "createdAt" timestamp, - "updatedAt" timestamp -); ---> statement-breakpoint -ALTER TABLE "verification" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "id" SET DEFAULT uuid_generate_v4();--> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "emailVerified" SET DATA TYPE boolean;--> statement-breakpoint -ALTER TABLE "user" ALTER COLUMN "emailVerified" SET NOT NULL;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "createdAt" timestamp DEFAULT now() NOT NULL;--> statement-breakpoint -ALTER TABLE "user" ADD COLUMN "updatedAt" timestamp DEFAULT now() NOT NULL;--> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "account" ADD CONSTRAINT "account_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 $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "apikey" ADD CONSTRAINT "apikey_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 $$; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "session" ADD CONSTRAINT "session_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 $$; diff --git a/packages/db/migrations/0011_cultured_red_skull.sql b/packages/db/migrations/0011_cultured_red_skull.sql deleted file mode 100644 index d812fa07..00000000 --- a/packages/db/migrations/0011_cultured_red_skull.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE "apikey" RENAME TO "apiKey";--> statement-breakpoint -ALTER TABLE "apiKey" DROP CONSTRAINT "apikey_userId_user_id_fk"; ---> statement-breakpoint -DO $$ BEGIN - ALTER TABLE "apiKey" ADD CONSTRAINT "apiKey_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 $$; diff --git a/packages/db/migrations/0000_eager_krista_starr.sql b/packages/db/migrations/20250508083758_SetupTables.sql similarity index 74% rename from packages/db/migrations/0000_eager_krista_starr.sql rename to packages/db/migrations/20250508083758_SetupTables.sql index 855f54cf..ab14b2e7 100644 --- a/packages/db/migrations/0000_eager_krista_starr.sql +++ b/packages/db/migrations/20250508083758_SetupTables.sql @@ -1,13 +1,84 @@ +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + +CREATE TYPE "public"."board_visibility" AS ENUM('private', 'public');--> statement-breakpoint CREATE TYPE "public"."card_activity_type" AS ENUM('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');--> statement-breakpoint CREATE TYPE "public"."source" AS ENUM('trello');--> statement-breakpoint CREATE TYPE "public"."status" AS ENUM('started', 'success', 'failed');--> statement-breakpoint CREATE TYPE "public"."role" AS ENUM('admin', 'member', 'guest');--> statement-breakpoint CREATE TYPE "public"."member_status" AS ENUM('invited', 'active', 'removed');--> statement-breakpoint CREATE TYPE "public"."slug_type" AS ENUM('reserved', 'premium');--> statement-breakpoint +CREATE TYPE "public"."workspace_plan" AS ENUM('free', 'pro', 'enterprise');--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "account" ( + "id" bigserial PRIMARY KEY NOT NULL, + "accountId" text NOT NULL, + "providerId" text NOT NULL, + "userId" uuid NOT NULL, + "accessToken" text, + "refreshToken" text, + "idToken" text, + "accessTokenExpiresAt" timestamp, + "refreshTokenExpiresAt" timestamp, + "scope" text, + "password" text, + "createdAt" timestamp NOT NULL, + "updatedAt" timestamp NOT NULL +); +--> statement-breakpoint +ALTER TABLE "account" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "apiKey" ( + "id" bigserial PRIMARY KEY NOT NULL, + "name" text, + "start" text, + "prefix" text, + "key" text NOT NULL, + "userId" uuid NOT NULL, + "refillInterval" integer, + "refillAmount" integer, + "lastRefillAt" timestamp, + "enabled" boolean, + "rateLimitEnabled" boolean, + "rateLimitTimeWindow" integer, + "rateLimitMax" integer, + "requestCount" integer, + "remaining" integer, + "lastRequest" timestamp, + "expiresAt" timestamp, + "createdAt" timestamp NOT NULL, + "updatedAt" timestamp NOT NULL, + "permissions" text, + "metadata" text +); +--> statement-breakpoint +ALTER TABLE "apiKey" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "session" ( + "id" bigserial PRIMARY KEY NOT NULL, + "expiresAt" timestamp NOT NULL, + "token" text NOT NULL, + "createdAt" timestamp NOT NULL, + "updatedAt" timestamp NOT NULL, + "ipAddress" text, + "userAgent" text, + "userId" uuid NOT NULL, + CONSTRAINT "session_token_unique" UNIQUE("token") +); +--> statement-breakpoint +ALTER TABLE "session" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "verification" ( + "id" bigserial PRIMARY KEY NOT NULL, + "identifier" text NOT NULL, + "value" text NOT NULL, + "expiresAt" timestamp NOT NULL, + "createdAt" timestamp, + "updatedAt" timestamp +); +--> statement-breakpoint +ALTER TABLE "verification" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "board" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, "name" varchar(255) NOT NULL, + "description" text, + "slug" varchar(255) NOT NULL, "createdBy" uuid NOT NULL, "createdAt" timestamp DEFAULT now() NOT NULL, "updatedAt" timestamp, @@ -15,9 +86,11 @@ CREATE TABLE IF NOT EXISTS "board" ( "deletedBy" uuid, "importId" bigint, "workspaceId" bigint NOT NULL, + "visibility" "board_visibility" DEFAULT 'private' NOT NULL, CONSTRAINT "board_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "board" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "card_activity" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -41,12 +114,14 @@ CREATE TABLE IF NOT EXISTS "card_activity" ( CONSTRAINT "card_activity_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "card_activity" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "_card_workspace_members" ( "cardId" bigint NOT NULL, "workspaceMemberId" bigint NOT NULL, CONSTRAINT "_card_workspace_members_cardId_workspaceMemberId_pk" PRIMARY KEY("cardId","workspaceMemberId") ); --> statement-breakpoint +ALTER TABLE "_card_workspace_members" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "card" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -63,12 +138,14 @@ CREATE TABLE IF NOT EXISTS "card" ( CONSTRAINT "card_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "card" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "_card_labels" ( "cardId" bigint NOT NULL, "labelId" bigint NOT NULL, CONSTRAINT "_card_labels_cardId_labelId_pk" PRIMARY KEY("cardId","labelId") ); --> statement-breakpoint +ALTER TABLE "_card_labels" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "card_comments" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -82,6 +159,18 @@ CREATE TABLE IF NOT EXISTS "card_comments" ( CONSTRAINT "card_comments_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "card_comments" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "feedback" ( + "id" bigserial PRIMARY KEY NOT NULL, + "feedback" text NOT NULL, + "createdBy" uuid NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp, + "url" text NOT NULL, + "reviewed" boolean DEFAULT false NOT NULL +); +--> statement-breakpoint +ALTER TABLE "feedback" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "import" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -92,6 +181,7 @@ CREATE TABLE IF NOT EXISTS "import" ( CONSTRAINT "import_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "import" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "label" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -105,6 +195,7 @@ CREATE TABLE IF NOT EXISTS "label" ( CONSTRAINT "label_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "label" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "list" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -120,21 +211,26 @@ CREATE TABLE IF NOT EXISTS "list" ( CONSTRAINT "list_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "list" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "user" ( + "id" uuid PRIMARY KEY DEFAULT uuid_generate_v4() NOT NULL, + "name" varchar(255), + "email" varchar(255) NOT NULL, + "emailVerified" boolean NOT NULL, + "image" varchar(255), + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp DEFAULT now() NOT NULL, + "stripeCustomerId" varchar(255), + CONSTRAINT "user_email_unique" UNIQUE("email") +); +--> statement-breakpoint +ALTER TABLE "user" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "workspace_slugs" ( "slug" varchar(255) NOT NULL, "type" "slug_type" NOT NULL, CONSTRAINT "workspace_slugs_slug_unique" UNIQUE("slug") ); --> statement-breakpoint -CREATE TABLE IF NOT EXISTS "user" ( - "id" uuid PRIMARY KEY NOT NULL, - "name" varchar(255), - "email" varchar(255) NOT NULL, - "emailVerified" timestamp, - "image" varchar(255), - CONSTRAINT "user_email_unique" UNIQUE("email") -); ---> statement-breakpoint CREATE TABLE IF NOT EXISTS "workspace_members" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, @@ -150,11 +246,14 @@ CREATE TABLE IF NOT EXISTS "workspace_members" ( CONSTRAINT "workspace_members_publicId_unique" UNIQUE("publicId") ); --> statement-breakpoint +ALTER TABLE "workspace_members" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint CREATE TABLE IF NOT EXISTS "workspace" ( "id" bigserial PRIMARY KEY NOT NULL, "publicId" varchar(12) NOT NULL, "name" varchar(255) NOT NULL, + "description" text, "slug" varchar(255) NOT NULL, + "plan" "workspace_plan" DEFAULT 'free' NOT NULL, "createdBy" uuid NOT NULL, "createdAt" timestamp DEFAULT now() NOT NULL, "updatedAt" timestamp, @@ -164,6 +263,25 @@ CREATE TABLE IF NOT EXISTS "workspace" ( CONSTRAINT "workspace_slug_unique" UNIQUE("slug") ); --> statement-breakpoint +ALTER TABLE "workspace" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "account" ADD CONSTRAINT "account_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 $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "apiKey" ADD CONSTRAINT "apiKey_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 $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "session" ADD CONSTRAINT "session_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 $$; +--> statement-breakpoint DO $$ BEGIN ALTER TABLE "board" ADD CONSTRAINT "board_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; EXCEPTION @@ -296,6 +414,12 @@ EXCEPTION WHEN duplicate_object THEN null; END $$; --> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "feedback" ADD CONSTRAINT "feedback_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint DO $$ BEGIN ALTER TABLE "import" ADD CONSTRAINT "import_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action; EXCEPTION @@ -373,3 +497,6 @@ DO $$ BEGIN EXCEPTION WHEN duplicate_object THEN null; END $$; +--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "board_visibility_idx" ON "board" USING btree ("visibility");--> statement-breakpoint +CREATE UNIQUE INDEX IF NOT EXISTS "unique_slug_per_workspace" ON "board" USING btree ("workspaceId","slug") WHERE "board"."deletedAt" IS NULL; \ No newline at end of file diff --git a/packages/db/migrations/meta/0000_snapshot.json b/packages/db/migrations/meta/0000_snapshot.json deleted file mode 100644 index 84919caa..00000000 --- a/packages/db/migrations/meta/0000_snapshot.json +++ /dev/null @@ -1,1485 +0,0 @@ -{ - "id": "3bf82a86-d7ff-4ab7-81ed-024350dfb32a", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "7", - "dialect": "postgresql", - "tables": { - "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 - }, - "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 - }, - "importId": { - "name": "importId", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "workspaceId": { - "name": "workspaceId", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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 - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0001_snapshot.json b/packages/db/migrations/meta/0001_snapshot.json deleted file mode 100644 index ce27758a..00000000 --- a/packages/db/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,1491 +0,0 @@ -{ - "id": "dbb6beb4-cd15-47c0-959a-64d161045634", - "prevId": "3bf82a86-d7ff-4ab7-81ed-024350dfb32a", - "version": "7", - "dialect": "postgresql", - "tables": { - "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 - }, - "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 - }, - "importId": { - "name": "importId", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "workspaceId": { - "name": "workspaceId", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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 - }, - "slug": { - "name": "slug", - "type": "varchar(255)", - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0002_snapshot.json b/packages/db/migrations/meta/0002_snapshot.json deleted file mode 100644 index a4fae557..00000000 --- a/packages/db/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,1508 +0,0 @@ -{ - "id": "772f24ff-4558-4003-9495-29ebb4f36279", - "prevId": "dbb6beb4-cd15-47c0-959a-64d161045634", - "version": "7", - "dialect": "postgresql", - "tables": { - "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 - }, - "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 - }, - "importId": { - "name": "importId", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "workspaceId": { - "name": "workspaceId", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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 - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0003_snapshot.json b/packages/db/migrations/meta/0003_snapshot.json deleted file mode 100644 index 5e095976..00000000 --- a/packages/db/migrations/meta/0003_snapshot.json +++ /dev/null @@ -1,1514 +0,0 @@ -{ - "id": "f8dbccfb-c99d-4e76-91f7-9bddee1c5585", - "prevId": "772f24ff-4558-4003-9495-29ebb4f36279", - "version": "7", - "dialect": "postgresql", - "tables": { - "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 - }, - "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 - }, - "importId": { - "name": "importId", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "workspaceId": { - "name": "workspaceId", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0004_snapshot.json b/packages/db/migrations/meta/0004_snapshot.json deleted file mode 100644 index dea6b32d..00000000 --- a/packages/db/migrations/meta/0004_snapshot.json +++ /dev/null @@ -1,1548 +0,0 @@ -{ - "id": "359bf96c-acb0-4c87-b234-fb82b5f804f8", - "prevId": "f8dbccfb-c99d-4e76-91f7-9bddee1c5585", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "importId": { - "name": "importId", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "workspaceId": { - "name": "workspaceId", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "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, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0005_snapshot.json b/packages/db/migrations/meta/0005_snapshot.json deleted file mode 100644 index f5af861d..00000000 --- a/packages/db/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,1579 +0,0 @@ -{ - "id": "7a88e14a-24f1-42c6-b025-b0b1befb1377", - "prevId": "359bf96c-acb0-4c87-b234-fb82b5f804f8", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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.board_visibility": { - "name": "board_visibility", - "schema": "public", - "values": [ - "private", - "public" - ] - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0006_snapshot.json b/packages/db/migrations/meta/0006_snapshot.json deleted file mode 100644 index 67ae8e77..00000000 --- a/packages/db/migrations/meta/0006_snapshot.json +++ /dev/null @@ -1,1650 +0,0 @@ -{ - "id": "6f5cb6e9-d03e-4234-acce-f6eec2870c49", - "prevId": "7a88e14a-24f1-42c6-b025-b0b1befb1377", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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.board_visibility": { - "name": "board_visibility", - "schema": "public", - "values": [ - "private", - "public" - ] - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0007_snapshot.json b/packages/db/migrations/meta/0007_snapshot.json deleted file mode 100644 index 4d9fe9a1..00000000 --- a/packages/db/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,1651 +0,0 @@ -{ - "id": "cd98372e-e781-4864-8813-eee66f5e5568", - "prevId": "6f5cb6e9-d03e-4234-acce-f6eec2870c49", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "where": "\"board\".\"deletedAt\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "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.board_visibility": { - "name": "board_visibility", - "schema": "public", - "values": [ - "private", - "public" - ] - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0008_snapshot.json b/packages/db/migrations/meta/0008_snapshot.json deleted file mode 100644 index 89663c8a..00000000 --- a/packages/db/migrations/meta/0008_snapshot.json +++ /dev/null @@ -1,2004 +0,0 @@ -{ - "id": "164a9145-d0f6-4651-b25c-ecc713054951", - "prevId": "cd98372e-e781-4864-8813-eee66f5e5568", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "where": "\"board\".\"deletedAt\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to boards in user's workspace or public boards": { - "name": "Allow access to boards in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n OR visibility = 'public'\n " - }, - "Allow inserting boards in user's workspace": { - "name": "Allow inserting boards in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n " - }, - "Allow updating boards in user's workspace": { - "name": "Allow updating boards in user's workspace", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n " - }, - "Allow deleting boards in user's workspace": { - "name": "Allow deleting boards in user's workspace", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n " - } - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to card activity in user's workspace or public boards": { - "name": "Allow access to card activity in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting card activity in user's workspace": { - "name": "Allow inserting card activity in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_workspace_members_cardId_workspaceMemberId_pk": { - "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] - } - }, - "uniqueConstraints": {}, - "policies": { - "Allow access to card workspace members in user's workspace": { - "name": "Allow access to card workspace members in user's workspace", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n AND\n \"workspaceMemberId\" IN (\n SELECT wm.id\n FROM workspace_members wm\n WHERE wm.\"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n )\n " - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to cards in user's workspace or public boards": { - "name": "Allow access to cards in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"listId\" IN (\n SELECT l.id\n FROM list l\n JOIN board b ON l.\"boardId\" = b.id\n LEFT JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting cards in user's workspace": { - "name": "Allow inserting cards in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"listId\" IN (\n SELECT l.id\n FROM list l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow updating cards in user's workspace": { - "name": "Allow updating cards in user's workspace", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"listId\" IN (\n SELECT l.id\n FROM list l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow deleting cards in user's workspace": { - "name": "Allow deleting cards in user's workspace", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"listId\" IN (\n SELECT l.id\n FROM list l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": { - "_card_labels_cardId_labelId_pk": { - "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] - } - }, - "uniqueConstraints": {}, - "policies": { - "Allow access to card labels in user's workspace or public boards": { - "name": "Allow access to card labels in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n LEFT JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\" AND wm.\"userId\" = auth.uid()\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n AND\n \"labelId\" IN (\n SELECT l.id\n FROM label l\n JOIN board b ON l.\"boardId\" = b.id\n LEFT JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\" AND wm.\"userId\" = auth.uid()\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting card labels in user's workspace": { - "name": "Allow inserting card labels in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n AND\n \"labelId\" IN (\n SELECT l.id\n FROM label l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow updating card labels in user's workspace": { - "name": "Allow updating card labels in user's workspace", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n AND\n \"labelId\" IN (\n SELECT l.id\n FROM label l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow deleting card labels in user's workspace": { - "name": "Allow deleting card labels in user's workspace", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n AND\n \"labelId\" IN (\n SELECT l.id\n FROM label l\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to card comments in user's workspace or public boards": { - "name": "Allow access to card comments in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting comments on cards in user's workspace": { - "name": "Allow inserting comments on cards in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"cardId\" IN (\n SELECT c.id\n FROM card c\n JOIN list l ON c.\"listId\" = l.id\n JOIN board b ON l.\"boardId\" = b.id\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow updating own comments": { - "name": "Allow updating own comments", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"createdBy\" = auth.uid()\n " - }, - "Allow deleting own comments": { - "name": "Allow deleting own comments", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"createdBy\" = auth.uid()\n " - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to user's own imports": { - "name": "Allow access to user's own imports", - "as": "PERMISSIVE", - "for": "ALL", - "to": [ - "authenticated" - ], - "using": "\n \"createdBy\" = auth.uid()\n " - } - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to labels in user's workspace or public boards": { - "name": "Allow access to labels in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n LEFT JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting labels in user's workspace": { - "name": "Allow inserting labels in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow updating labels in user's workspace": { - "name": "Allow updating labels in user's workspace", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow deleting labels in user's workspace": { - "name": "Allow deleting labels in user's workspace", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow access to lists in user's workspace or public boards": { - "name": "Allow access to lists in user's workspace or public boards", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n LEFT JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n OR b.visibility = 'public'\n )\n " - }, - "Allow inserting lists in user's workspace": { - "name": "Allow inserting lists in user's workspace", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow updating lists in user's workspace": { - "name": "Allow updating lists in user's workspace", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - }, - "Allow deleting lists in user's workspace": { - "name": "Allow deleting lists in user's workspace", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n \"boardId\" IN (\n SELECT b.id\n FROM board b\n JOIN workspace_members wm ON b.\"workspaceId\" = wm.\"workspaceId\"\n WHERE wm.\"userId\" = auth.uid()\n )\n " - } - }, - "checkConstraints": {}, - "isRLSEnabled": true - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "policies": { - "Allow viewing members in user's workspace": { - "name": "Allow viewing members in user's workspace", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "authenticated" - ], - "using": "\n id IN (\n SELECT wm.\"userId\"\n FROM workspace_members wm\n WHERE wm.\"workspaceId\" IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n )\n " - } - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": { - "Allow members to view workspace membership": { - "name": "Allow members to view workspace membership", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "authenticated" - ], - "using": "\n \"userId\" = auth.uid() OR\n is_workspace_member(auth.uid(), \"workspaceId\")\n " - }, - "Allow admins to add workspace members": { - "name": "Allow admins to add workspace members", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "\n is_workspace_admin(auth.uid(), \"workspaceId\")\n " - }, - "Allow admins to update workspace members": { - "name": "Allow admins to update workspace members", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n is_workspace_admin(auth.uid(), \"workspaceId\")\n " - }, - "Allow admins to remove workspace members": { - "name": "Allow admins to remove workspace members", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n is_workspace_admin(auth.uid(), \"workspaceId\")\n " - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "policies": { - "Allow viewing user's workspaces": { - "name": "Allow viewing user's workspaces", - "as": "PERMISSIVE", - "for": "SELECT", - "to": [ - "anon", - "authenticated" - ], - "using": "\n CASE \n WHEN auth.uid() IS NULL THEN\n EXISTS (\n SELECT 1 \n FROM board \n WHERE \"workspaceId\" = workspace.id \n AND visibility = 'public'\n )\n ELSE\n id IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n OR \"createdBy\" = auth.uid()\n END\n " - }, - "Allow updating user's workspaces": { - "name": "Allow updating user's workspaces", - "as": "PERMISSIVE", - "for": "UPDATE", - "to": [ - "authenticated" - ], - "using": "\n id IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n " - }, - "Allow deleting user's workspaces": { - "name": "Allow deleting user's workspaces", - "as": "PERMISSIVE", - "for": "DELETE", - "to": [ - "authenticated" - ], - "using": "\n id IN (\n SELECT \"workspaceId\"\n FROM workspace_members\n WHERE \"userId\" = auth.uid()\n )\n " - }, - "Allow authenticated users to create workspaces": { - "name": "Allow authenticated users to create workspaces", - "as": "PERMISSIVE", - "for": "INSERT", - "to": [ - "authenticated" - ], - "withCheck": "true" - } - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0009_snapshot.json b/packages/db/migrations/meta/0009_snapshot.json deleted file mode 100644 index 183a18ad..00000000 --- a/packages/db/migrations/meta/0009_snapshot.json +++ /dev/null @@ -1,1651 +0,0 @@ -{ - "id": "0564220f-2da3-41be-b394-65ee7964f491", - "prevId": "164a9145-d0f6-4651-b25c-ecc713054951", - "version": "7", - "dialect": "postgresql", - "tables": { - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "where": "\"board\".\"deletedAt\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": true - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "uuid", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "varchar(255)", - "primaryKey": false, - "notNull": true - }, - "emailVerified": { - "name": "emailVerified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - }, - "stripeCustomerId": { - "name": "stripeCustomerId", - "type": "varchar(255)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "user_email_unique": { - "name": "user_email_unique", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0010_snapshot.json b/packages/db/migrations/meta/0010_snapshot.json deleted file mode 100644 index 9a4d6364..00000000 --- a/packages/db/migrations/meta/0010_snapshot.json +++ /dev/null @@ -1,2056 +0,0 @@ -{ - "id": "c90c5bad-c333-4f2d-a401-4b3072473cdc", - "prevId": "0564220f-2da3-41be-b394-65ee7964f491", - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "session_token_unique": { - "name": "session_token_unique", - "nullsNotDistinct": false, - "columns": [ - "token" - ] - } - }, - "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": 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 - }, - "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, - "concurrently": false, - "method": "btree", - "with": {} - }, - "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, - "where": "\"board\".\"deletedAt\" IS NULL", - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "board_createdBy_user_id_fk": { - "name": "board_createdBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_deletedBy_user_id_fk": { - "name": "board_deletedBy_user_id_fk", - "tableFrom": "board", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_importId_import_id_fk": { - "name": "board_importId_import_id_fk", - "tableFrom": "board", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "board_workspaceId_workspace_id_fk": { - "name": "board_workspaceId_workspace_id_fk", - "tableFrom": "board", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_publicId_unique": { - "name": "board_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_activity_fromListId_list_id_fk": { - "name": "card_activity_fromListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_toListId_list_id_fk": { - "name": "card_activity_toListId_list_id_fk", - "tableFrom": "card_activity", - "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_labelId_label_id_fk": { - "name": "card_activity_labelId_label_id_fk", - "tableFrom": "card_activity", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_workspaceMemberId_workspace_members_id_fk": { - "name": "card_activity_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "card_activity", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_createdBy_user_id_fk": { - "name": "card_activity_createdBy_user_id_fk", - "tableFrom": "card_activity", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_activity_commentId_card_comments_id_fk": { - "name": "card_activity_commentId_card_comments_id_fk", - "tableFrom": "card_activity", - "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_activity_publicId_unique": { - "name": "card_activity_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_workspace_members_workspaceMemberId_workspace_members_id_fk": { - "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", - "tableFrom": "_card_workspace_members", - "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_deletedBy_user_id_fk": { - "name": "card_deletedBy_user_id_fk", - "tableFrom": "card", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_listId_list_id_fk": { - "name": "card_listId_list_id_fk", - "tableFrom": "card", - "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_importId_import_id_fk": { - "name": "card_importId_import_id_fk", - "tableFrom": "card", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_publicId_unique": { - "name": "card_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "_card_labels_labelId_label_id_fk": { - "name": "_card_labels_labelId_label_id_fk", - "tableFrom": "_card_labels", - "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "card_comments_cardId_card_id_fk": { - "name": "card_comments_cardId_card_id_fk", - "tableFrom": "card_comments", - "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "card_comments_createdBy_user_id_fk": { - "name": "card_comments_createdBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "card_comments_deletedBy_user_id_fk": { - "name": "card_comments_deletedBy_user_id_fk", - "tableFrom": "card_comments", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "card_comments_publicId_unique": { - "name": "card_comments_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "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": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "import_publicId_unique": { - "name": "import_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": true - }, - "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 - } - }, - "indexes": {}, - "foreignKeys": { - "label_createdBy_user_id_fk": { - "name": "label_createdBy_user_id_fk", - "tableFrom": "label", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "label_boardId_board_id_fk": { - "name": "label_boardId_board_id_fk", - "tableFrom": "label", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "label_importId_import_id_fk": { - "name": "label_importId_import_id_fk", - "tableFrom": "label", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "label_publicId_unique": { - "name": "label_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": 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 - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_deletedBy_user_id_fk": { - "name": "list_deletedBy_user_id_fk", - "tableFrom": "list", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "list_boardId_board_id_fk": { - "name": "list_boardId_board_id_fk", - "tableFrom": "list", - "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "list_importId_import_id_fk": { - "name": "list_importId_import_id_fk", - "tableFrom": "list", - "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "list_publicId_unique": { - "name": "list_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "email" - ] - } - }, - "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", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "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 - }, - "userId": { - "name": "userId", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "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", - "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_members_workspaceId_workspace_id_fk": { - "name": "workspace_members_workspaceId_workspace_id_fk", - "tableFrom": "workspace_members", - "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - }, - "workspace_members_deletedBy_user_id_fk": { - "name": "workspace_members_deletedBy_user_id_fk", - "tableFrom": "workspace_members", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_members_publicId_unique": { - "name": "workspace_members_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - } - }, - "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": 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 - } - }, - "indexes": {}, - "foreignKeys": { - "workspace_createdBy_user_id_fk": { - "name": "workspace_createdBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "workspace_deletedBy_user_id_fk": { - "name": "workspace_deletedBy_user_id_fk", - "tableFrom": "workspace", - "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "workspace_publicId_unique": { - "name": "workspace_publicId_unique", - "nullsNotDistinct": false, - "columns": [ - "publicId" - ] - }, - "workspace_slug_unique": { - "name": "workspace_slug_unique", - "nullsNotDistinct": false, - "columns": [ - "slug" - ] - } - }, - "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": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/packages/db/migrations/meta/0011_snapshot.json b/packages/db/migrations/meta/20250508083758_snapshot.json similarity index 99% rename from packages/db/migrations/meta/0011_snapshot.json rename to packages/db/migrations/meta/20250508083758_snapshot.json index 173259f8..92e7160d 100644 --- a/packages/db/migrations/meta/0011_snapshot.json +++ b/packages/db/migrations/meta/20250508083758_snapshot.json @@ -1,6 +1,6 @@ { - "id": "35d5003d-ba19-45d4-81bc-5dfd24a8c8af", - "prevId": "c90c5bad-c333-4f2d-a401-4b3072473cdc", + "id": "601a411c-27ca-4b1c-b0bf-983ffbb119f9", + "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", "tables": { diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 98ed36bc..9314c308 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -5,85 +5,8 @@ { "idx": 0, "version": "7", - "when": 1735766172233, - "tag": "0000_eager_krista_starr", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1735821726274, - "tag": "0001_little_red_hulk", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1735904544867, - "tag": "0002_bored_retro_girl", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1736084845433, - "tag": "0003_fine_bedlam", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1736087559461, - "tag": "0004_eminent_living_mummy", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1737130330536, - "tag": "0005_modern_gideon", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1738149668712, - "tag": "0006_spicy_mach_iv", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1738168854269, - "tag": "0007_redundant_silver_fox", - "breakpoints": true - }, - { - "idx": 8, - "version": "7", - "when": 1744906695652, - "tag": "0008_mature_ravenous", - "breakpoints": true - }, - { - "idx": 9, - "version": "7", - "when": 1745407291997, - "tag": "0009_shallow_silver_surfer", - "breakpoints": true - }, - { - "idx": 10, - "version": "7", - "when": 1746224485085, - "tag": "0010_wet_true_believers", - "breakpoints": true - }, - { - "idx": 11, - "version": "7", - "when": 1746224588889, - "tag": "0011_cultured_red_skull", + "when": 1746693478656, + "tag": "20250508083758_SetupTables", "breakpoints": true } ]