feat: setup checklist schema
This commit is contained in:
84
packages/db/migrations/20250715123447_AddCardChecklists.sql
Normal file
84
packages/db/migrations/20250715123447_AddCardChecklists.sql
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS "card_checklist_item" (
|
||||||
|
"id" bigserial PRIMARY KEY NOT NULL,
|
||||||
|
"publicId" varchar(12) NOT NULL,
|
||||||
|
"title" varchar(500) NOT NULL,
|
||||||
|
"completed" boolean DEFAULT false NOT NULL,
|
||||||
|
"index" integer NOT NULL,
|
||||||
|
"checklistId" bigint NOT NULL,
|
||||||
|
"createdBy" uuid,
|
||||||
|
"createdAt" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"updatedAt" timestamp,
|
||||||
|
"deletedAt" timestamp,
|
||||||
|
"deletedBy" uuid,
|
||||||
|
CONSTRAINT "card_checklist_item_publicId_unique" UNIQUE("publicId")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "card_checklist_item" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "card_checklist" (
|
||||||
|
"id" bigserial PRIMARY KEY NOT NULL,
|
||||||
|
"publicId" varchar(12) NOT NULL,
|
||||||
|
"title" varchar(255) NOT NULL,
|
||||||
|
"index" integer NOT NULL,
|
||||||
|
"cardId" bigint NOT NULL,
|
||||||
|
"createdBy" uuid,
|
||||||
|
"createdAt" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"updatedAt" timestamp,
|
||||||
|
"deletedAt" timestamp,
|
||||||
|
"deletedBy" uuid,
|
||||||
|
CONSTRAINT "card_checklist_publicId_unique" UNIQUE("publicId")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "card_checklist" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "integration" (
|
||||||
|
"provider" varchar(255) NOT NULL,
|
||||||
|
"userId" uuid NOT NULL,
|
||||||
|
"accessToken" varchar(255) NOT NULL,
|
||||||
|
"refreshToken" varchar(255),
|
||||||
|
"expiresAt" timestamp NOT NULL,
|
||||||
|
"createdAt" timestamp NOT NULL,
|
||||||
|
"updatedAt" timestamp,
|
||||||
|
CONSTRAINT "integration_pkey" PRIMARY KEY("userId","provider")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "integration" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist_item" ADD CONSTRAINT "card_checklist_item_checklistId_card_checklist_id_fk" FOREIGN KEY ("checklistId") REFERENCES "public"."card_checklist"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist_item" ADD CONSTRAINT "card_checklist_item_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist_item" ADD CONSTRAINT "card_checklist_item_deletedBy_user_id_fk" FOREIGN KEY ("deletedBy") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist" ADD CONSTRAINT "card_checklist_cardId_card_id_fk" FOREIGN KEY ("cardId") REFERENCES "public"."card"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist" ADD CONSTRAINT "card_checklist_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "card_checklist" ADD CONSTRAINT "card_checklist_deletedBy_user_id_fk" FOREIGN KEY ("deletedBy") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "integration" ADD CONSTRAINT "integration_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"id": "91f9a2fa-31e2-4f3a-bdb9-852292fd7501",
|
"id": "91f9a2fa-31e2-4f3a-bdb9-852292fd7501",
|
||||||
"prevId": "058e8521-2814-46f0-a33f-1bbd86f450ce",
|
"prevId": "d170c8e0-bf75-4c71-abd9-0ecbeeb14003",
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"dialect": "postgresql",
|
"dialect": "postgresql",
|
||||||
"tables": {
|
"tables": {
|
||||||
@@ -92,13 +92,9 @@
|
|||||||
"account_userId_user_id_fk": {
|
"account_userId_user_id_fk": {
|
||||||
"name": "account_userId_user_id_fk",
|
"name": "account_userId_user_id_fk",
|
||||||
"tableFrom": "account",
|
"tableFrom": "account",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["userId"],
|
||||||
"userId"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -245,13 +241,9 @@
|
|||||||
"apiKey_userId_user_id_fk": {
|
"apiKey_userId_user_id_fk": {
|
||||||
"name": "apiKey_userId_user_id_fk",
|
"name": "apiKey_userId_user_id_fk",
|
||||||
"tableFrom": "apiKey",
|
"tableFrom": "apiKey",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["userId"],
|
||||||
"userId"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -320,13 +312,9 @@
|
|||||||
"session_userId_user_id_fk": {
|
"session_userId_user_id_fk": {
|
||||||
"name": "session_userId_user_id_fk",
|
"name": "session_userId_user_id_fk",
|
||||||
"tableFrom": "session",
|
"tableFrom": "session",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["userId"],
|
||||||
"userId"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -335,9 +323,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"session_token_unique": {
|
"session_token_unique": {
|
||||||
"name": "session_token_unique",
|
"name": "session_token_unique",
|
||||||
"columns": [
|
"columns": ["token"],
|
||||||
"token"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -523,52 +509,36 @@
|
|||||||
"board_createdBy_user_id_fk": {
|
"board_createdBy_user_id_fk": {
|
||||||
"name": "board_createdBy_user_id_fk",
|
"name": "board_createdBy_user_id_fk",
|
||||||
"tableFrom": "board",
|
"tableFrom": "board",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"board_deletedBy_user_id_fk": {
|
"board_deletedBy_user_id_fk": {
|
||||||
"name": "board_deletedBy_user_id_fk",
|
"name": "board_deletedBy_user_id_fk",
|
||||||
"tableFrom": "board",
|
"tableFrom": "board",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"board_importId_import_id_fk": {
|
"board_importId_import_id_fk": {
|
||||||
"name": "board_importId_import_id_fk",
|
"name": "board_importId_import_id_fk",
|
||||||
"tableFrom": "board",
|
"tableFrom": "board",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["importId"],
|
||||||
"importId"
|
|
||||||
],
|
|
||||||
"tableTo": "import",
|
"tableTo": "import",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "no action"
|
"onDelete": "no action"
|
||||||
},
|
},
|
||||||
"board_workspaceId_workspace_id_fk": {
|
"board_workspaceId_workspace_id_fk": {
|
||||||
"name": "board_workspaceId_workspace_id_fk",
|
"name": "board_workspaceId_workspace_id_fk",
|
||||||
"tableFrom": "board",
|
"tableFrom": "board",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["workspaceId"],
|
||||||
"workspaceId"
|
|
||||||
],
|
|
||||||
"tableTo": "workspace",
|
"tableTo": "workspace",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -577,9 +547,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"board_publicId_unique": {
|
"board_publicId_unique": {
|
||||||
"name": "board_publicId_unique",
|
"name": "board_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -713,91 +681,63 @@
|
|||||||
"card_activity_cardId_card_id_fk": {
|
"card_activity_cardId_card_id_fk": {
|
||||||
"name": "card_activity_cardId_card_id_fk",
|
"name": "card_activity_cardId_card_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["cardId"],
|
||||||
"cardId"
|
|
||||||
],
|
|
||||||
"tableTo": "card",
|
"tableTo": "card",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_activity_fromListId_list_id_fk": {
|
"card_activity_fromListId_list_id_fk": {
|
||||||
"name": "card_activity_fromListId_list_id_fk",
|
"name": "card_activity_fromListId_list_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["fromListId"],
|
||||||
"fromListId"
|
|
||||||
],
|
|
||||||
"tableTo": "list",
|
"tableTo": "list",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_activity_toListId_list_id_fk": {
|
"card_activity_toListId_list_id_fk": {
|
||||||
"name": "card_activity_toListId_list_id_fk",
|
"name": "card_activity_toListId_list_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["toListId"],
|
||||||
"toListId"
|
|
||||||
],
|
|
||||||
"tableTo": "list",
|
"tableTo": "list",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_activity_labelId_label_id_fk": {
|
"card_activity_labelId_label_id_fk": {
|
||||||
"name": "card_activity_labelId_label_id_fk",
|
"name": "card_activity_labelId_label_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["labelId"],
|
||||||
"labelId"
|
|
||||||
],
|
|
||||||
"tableTo": "label",
|
"tableTo": "label",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_activity_workspaceMemberId_workspace_members_id_fk": {
|
"card_activity_workspaceMemberId_workspace_members_id_fk": {
|
||||||
"name": "card_activity_workspaceMemberId_workspace_members_id_fk",
|
"name": "card_activity_workspaceMemberId_workspace_members_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["workspaceMemberId"],
|
||||||
"workspaceMemberId"
|
|
||||||
],
|
|
||||||
"tableTo": "workspace_members",
|
"tableTo": "workspace_members",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"card_activity_createdBy_user_id_fk": {
|
"card_activity_createdBy_user_id_fk": {
|
||||||
"name": "card_activity_createdBy_user_id_fk",
|
"name": "card_activity_createdBy_user_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"card_activity_commentId_card_comments_id_fk": {
|
"card_activity_commentId_card_comments_id_fk": {
|
||||||
"name": "card_activity_commentId_card_comments_id_fk",
|
"name": "card_activity_commentId_card_comments_id_fk",
|
||||||
"tableFrom": "card_activity",
|
"tableFrom": "card_activity",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["commentId"],
|
||||||
"commentId"
|
|
||||||
],
|
|
||||||
"tableTo": "card_comments",
|
"tableTo": "card_comments",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -806,9 +746,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"card_activity_publicId_unique": {
|
"card_activity_publicId_unique": {
|
||||||
"name": "card_activity_publicId_unique",
|
"name": "card_activity_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -838,26 +776,18 @@
|
|||||||
"_card_workspace_members_cardId_card_id_fk": {
|
"_card_workspace_members_cardId_card_id_fk": {
|
||||||
"name": "_card_workspace_members_cardId_card_id_fk",
|
"name": "_card_workspace_members_cardId_card_id_fk",
|
||||||
"tableFrom": "_card_workspace_members",
|
"tableFrom": "_card_workspace_members",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["cardId"],
|
||||||
"cardId"
|
|
||||||
],
|
|
||||||
"tableTo": "card",
|
"tableTo": "card",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"_card_workspace_members_workspaceMemberId_workspace_members_id_fk": {
|
"_card_workspace_members_workspaceMemberId_workspace_members_id_fk": {
|
||||||
"name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk",
|
"name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk",
|
||||||
"tableFrom": "_card_workspace_members",
|
"tableFrom": "_card_workspace_members",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["workspaceMemberId"],
|
||||||
"workspaceMemberId"
|
|
||||||
],
|
|
||||||
"tableTo": "workspace_members",
|
"tableTo": "workspace_members",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -865,10 +795,7 @@
|
|||||||
"compositePrimaryKeys": {
|
"compositePrimaryKeys": {
|
||||||
"_card_workspace_members_cardId_workspaceMemberId_pk": {
|
"_card_workspace_members_cardId_workspaceMemberId_pk": {
|
||||||
"name": "_card_workspace_members_cardId_workspaceMemberId_pk",
|
"name": "_card_workspace_members_cardId_workspaceMemberId_pk",
|
||||||
"columns": [
|
"columns": ["cardId", "workspaceMemberId"]
|
||||||
"cardId",
|
|
||||||
"workspaceMemberId"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uniqueConstraints": {},
|
"uniqueConstraints": {},
|
||||||
@@ -959,52 +886,36 @@
|
|||||||
"card_createdBy_user_id_fk": {
|
"card_createdBy_user_id_fk": {
|
||||||
"name": "card_createdBy_user_id_fk",
|
"name": "card_createdBy_user_id_fk",
|
||||||
"tableFrom": "card",
|
"tableFrom": "card",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"card_deletedBy_user_id_fk": {
|
"card_deletedBy_user_id_fk": {
|
||||||
"name": "card_deletedBy_user_id_fk",
|
"name": "card_deletedBy_user_id_fk",
|
||||||
"tableFrom": "card",
|
"tableFrom": "card",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"card_listId_list_id_fk": {
|
"card_listId_list_id_fk": {
|
||||||
"name": "card_listId_list_id_fk",
|
"name": "card_listId_list_id_fk",
|
||||||
"tableFrom": "card",
|
"tableFrom": "card",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["listId"],
|
||||||
"listId"
|
|
||||||
],
|
|
||||||
"tableTo": "list",
|
"tableTo": "list",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_importId_import_id_fk": {
|
"card_importId_import_id_fk": {
|
||||||
"name": "card_importId_import_id_fk",
|
"name": "card_importId_import_id_fk",
|
||||||
"tableFrom": "card",
|
"tableFrom": "card",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["importId"],
|
||||||
"importId"
|
|
||||||
],
|
|
||||||
"tableTo": "import",
|
"tableTo": "import",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "no action"
|
"onDelete": "no action"
|
||||||
}
|
}
|
||||||
@@ -1013,9 +924,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"card_publicId_unique": {
|
"card_publicId_unique": {
|
||||||
"name": "card_publicId_unique",
|
"name": "card_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1045,26 +954,18 @@
|
|||||||
"_card_labels_cardId_card_id_fk": {
|
"_card_labels_cardId_card_id_fk": {
|
||||||
"name": "_card_labels_cardId_card_id_fk",
|
"name": "_card_labels_cardId_card_id_fk",
|
||||||
"tableFrom": "_card_labels",
|
"tableFrom": "_card_labels",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["cardId"],
|
||||||
"cardId"
|
|
||||||
],
|
|
||||||
"tableTo": "card",
|
"tableTo": "card",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"_card_labels_labelId_label_id_fk": {
|
"_card_labels_labelId_label_id_fk": {
|
||||||
"name": "_card_labels_labelId_label_id_fk",
|
"name": "_card_labels_labelId_label_id_fk",
|
||||||
"tableFrom": "_card_labels",
|
"tableFrom": "_card_labels",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["labelId"],
|
||||||
"labelId"
|
|
||||||
],
|
|
||||||
"tableTo": "label",
|
"tableTo": "label",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
}
|
}
|
||||||
@@ -1072,10 +973,7 @@
|
|||||||
"compositePrimaryKeys": {
|
"compositePrimaryKeys": {
|
||||||
"_card_labels_cardId_labelId_pk": {
|
"_card_labels_cardId_labelId_pk": {
|
||||||
"name": "_card_labels_cardId_labelId_pk",
|
"name": "_card_labels_cardId_labelId_pk",
|
||||||
"columns": [
|
"columns": ["cardId", "labelId"]
|
||||||
"cardId",
|
|
||||||
"labelId"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"uniqueConstraints": {},
|
"uniqueConstraints": {},
|
||||||
@@ -1148,39 +1046,27 @@
|
|||||||
"card_comments_cardId_card_id_fk": {
|
"card_comments_cardId_card_id_fk": {
|
||||||
"name": "card_comments_cardId_card_id_fk",
|
"name": "card_comments_cardId_card_id_fk",
|
||||||
"tableFrom": "card_comments",
|
"tableFrom": "card_comments",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["cardId"],
|
||||||
"cardId"
|
|
||||||
],
|
|
||||||
"tableTo": "card",
|
"tableTo": "card",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"card_comments_createdBy_user_id_fk": {
|
"card_comments_createdBy_user_id_fk": {
|
||||||
"name": "card_comments_createdBy_user_id_fk",
|
"name": "card_comments_createdBy_user_id_fk",
|
||||||
"tableFrom": "card_comments",
|
"tableFrom": "card_comments",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"card_comments_deletedBy_user_id_fk": {
|
"card_comments_deletedBy_user_id_fk": {
|
||||||
"name": "card_comments_deletedBy_user_id_fk",
|
"name": "card_comments_deletedBy_user_id_fk",
|
||||||
"tableFrom": "card_comments",
|
"tableFrom": "card_comments",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1189,9 +1075,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"card_comments_publicId_unique": {
|
"card_comments_publicId_unique": {
|
||||||
"name": "card_comments_publicId_unique",
|
"name": "card_comments_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1253,13 +1137,9 @@
|
|||||||
"feedback_createdBy_user_id_fk": {
|
"feedback_createdBy_user_id_fk": {
|
||||||
"name": "feedback_createdBy_user_id_fk",
|
"name": "feedback_createdBy_user_id_fk",
|
||||||
"tableFrom": "feedback",
|
"tableFrom": "feedback",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1319,13 +1199,9 @@
|
|||||||
"import_createdBy_user_id_fk": {
|
"import_createdBy_user_id_fk": {
|
||||||
"name": "import_createdBy_user_id_fk",
|
"name": "import_createdBy_user_id_fk",
|
||||||
"tableFrom": "import",
|
"tableFrom": "import",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1334,9 +1210,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"import_publicId_unique": {
|
"import_publicId_unique": {
|
||||||
"name": "import_publicId_unique",
|
"name": "import_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1421,52 +1295,36 @@
|
|||||||
"label_createdBy_user_id_fk": {
|
"label_createdBy_user_id_fk": {
|
||||||
"name": "label_createdBy_user_id_fk",
|
"name": "label_createdBy_user_id_fk",
|
||||||
"tableFrom": "label",
|
"tableFrom": "label",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"label_boardId_board_id_fk": {
|
"label_boardId_board_id_fk": {
|
||||||
"name": "label_boardId_board_id_fk",
|
"name": "label_boardId_board_id_fk",
|
||||||
"tableFrom": "label",
|
"tableFrom": "label",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["boardId"],
|
||||||
"boardId"
|
|
||||||
],
|
|
||||||
"tableTo": "board",
|
"tableTo": "board",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"label_importId_import_id_fk": {
|
"label_importId_import_id_fk": {
|
||||||
"name": "label_importId_import_id_fk",
|
"name": "label_importId_import_id_fk",
|
||||||
"tableFrom": "label",
|
"tableFrom": "label",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["importId"],
|
||||||
"importId"
|
|
||||||
],
|
|
||||||
"tableTo": "import",
|
"tableTo": "import",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "no action"
|
"onDelete": "no action"
|
||||||
},
|
},
|
||||||
"label_deletedBy_user_id_fk": {
|
"label_deletedBy_user_id_fk": {
|
||||||
"name": "label_deletedBy_user_id_fk",
|
"name": "label_deletedBy_user_id_fk",
|
||||||
"tableFrom": "label",
|
"tableFrom": "label",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1475,9 +1333,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"label_publicId_unique": {
|
"label_publicId_unique": {
|
||||||
"name": "label_publicId_unique",
|
"name": "label_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1562,52 +1418,36 @@
|
|||||||
"list_createdBy_user_id_fk": {
|
"list_createdBy_user_id_fk": {
|
||||||
"name": "list_createdBy_user_id_fk",
|
"name": "list_createdBy_user_id_fk",
|
||||||
"tableFrom": "list",
|
"tableFrom": "list",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"list_deletedBy_user_id_fk": {
|
"list_deletedBy_user_id_fk": {
|
||||||
"name": "list_deletedBy_user_id_fk",
|
"name": "list_deletedBy_user_id_fk",
|
||||||
"tableFrom": "list",
|
"tableFrom": "list",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"list_boardId_board_id_fk": {
|
"list_boardId_board_id_fk": {
|
||||||
"name": "list_boardId_board_id_fk",
|
"name": "list_boardId_board_id_fk",
|
||||||
"tableFrom": "list",
|
"tableFrom": "list",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["boardId"],
|
||||||
"boardId"
|
|
||||||
],
|
|
||||||
"tableTo": "board",
|
"tableTo": "board",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"list_importId_import_id_fk": {
|
"list_importId_import_id_fk": {
|
||||||
"name": "list_importId_import_id_fk",
|
"name": "list_importId_import_id_fk",
|
||||||
"tableFrom": "list",
|
"tableFrom": "list",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["importId"],
|
||||||
"importId"
|
|
||||||
],
|
|
||||||
"tableTo": "import",
|
"tableTo": "import",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "no action"
|
"onDelete": "no action"
|
||||||
}
|
}
|
||||||
@@ -1616,9 +1456,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"list_publicId_unique": {
|
"list_publicId_unique": {
|
||||||
"name": "list_publicId_unique",
|
"name": "list_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1688,9 +1526,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"user_email_unique": {
|
"user_email_unique": {
|
||||||
"name": "user_email_unique",
|
"name": "user_email_unique",
|
||||||
"columns": [
|
"columns": ["email"],
|
||||||
"email"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1722,9 +1558,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"workspace_slugs_slug_unique": {
|
"workspace_slugs_slug_unique": {
|
||||||
"name": "workspace_slugs_slug_unique",
|
"name": "workspace_slugs_slug_unique",
|
||||||
"columns": [
|
"columns": ["slug"],
|
||||||
"slug"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1818,39 +1652,27 @@
|
|||||||
"workspace_members_userId_user_id_fk": {
|
"workspace_members_userId_user_id_fk": {
|
||||||
"name": "workspace_members_userId_user_id_fk",
|
"name": "workspace_members_userId_user_id_fk",
|
||||||
"tableFrom": "workspace_members",
|
"tableFrom": "workspace_members",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["userId"],
|
||||||
"userId"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"workspace_members_workspaceId_workspace_id_fk": {
|
"workspace_members_workspaceId_workspace_id_fk": {
|
||||||
"name": "workspace_members_workspaceId_workspace_id_fk",
|
"name": "workspace_members_workspaceId_workspace_id_fk",
|
||||||
"tableFrom": "workspace_members",
|
"tableFrom": "workspace_members",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["workspaceId"],
|
||||||
"workspaceId"
|
|
||||||
],
|
|
||||||
"tableTo": "workspace",
|
"tableTo": "workspace",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "cascade"
|
"onDelete": "cascade"
|
||||||
},
|
},
|
||||||
"workspace_members_deletedBy_user_id_fk": {
|
"workspace_members_deletedBy_user_id_fk": {
|
||||||
"name": "workspace_members_deletedBy_user_id_fk",
|
"name": "workspace_members_deletedBy_user_id_fk",
|
||||||
"tableFrom": "workspace_members",
|
"tableFrom": "workspace_members",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1859,9 +1681,7 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"workspace_members_publicId_unique": {
|
"workspace_members_publicId_unique": {
|
||||||
"name": "workspace_members_publicId_unique",
|
"name": "workspace_members_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1948,26 +1768,18 @@
|
|||||||
"workspace_createdBy_user_id_fk": {
|
"workspace_createdBy_user_id_fk": {
|
||||||
"name": "workspace_createdBy_user_id_fk",
|
"name": "workspace_createdBy_user_id_fk",
|
||||||
"tableFrom": "workspace",
|
"tableFrom": "workspace",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["createdBy"],
|
||||||
"createdBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
},
|
},
|
||||||
"workspace_deletedBy_user_id_fk": {
|
"workspace_deletedBy_user_id_fk": {
|
||||||
"name": "workspace_deletedBy_user_id_fk",
|
"name": "workspace_deletedBy_user_id_fk",
|
||||||
"tableFrom": "workspace",
|
"tableFrom": "workspace",
|
||||||
"columnsFrom": [
|
"columnsFrom": ["deletedBy"],
|
||||||
"deletedBy"
|
|
||||||
],
|
|
||||||
"tableTo": "user",
|
"tableTo": "user",
|
||||||
"columnsTo": [
|
"columnsTo": ["id"],
|
||||||
"id"
|
|
||||||
],
|
|
||||||
"onUpdate": "no action",
|
"onUpdate": "no action",
|
||||||
"onDelete": "set null"
|
"onDelete": "set null"
|
||||||
}
|
}
|
||||||
@@ -1976,16 +1788,12 @@
|
|||||||
"uniqueConstraints": {
|
"uniqueConstraints": {
|
||||||
"workspace_publicId_unique": {
|
"workspace_publicId_unique": {
|
||||||
"name": "workspace_publicId_unique",
|
"name": "workspace_publicId_unique",
|
||||||
"columns": [
|
"columns": ["publicId"],
|
||||||
"publicId"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
},
|
},
|
||||||
"workspace_slug_unique": {
|
"workspace_slug_unique": {
|
||||||
"name": "workspace_slug_unique",
|
"name": "workspace_slug_unique",
|
||||||
"columns": [
|
"columns": ["slug"],
|
||||||
"slug"
|
|
||||||
],
|
|
||||||
"nullsNotDistinct": false
|
"nullsNotDistinct": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1998,10 +1806,7 @@
|
|||||||
"public.board_visibility": {
|
"public.board_visibility": {
|
||||||
"name": "board_visibility",
|
"name": "board_visibility",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["private", "public"]
|
||||||
"private",
|
|
||||||
"public"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.card_activity_type": {
|
"public.card_activity_type": {
|
||||||
"name": "card_activity_type",
|
"name": "card_activity_type",
|
||||||
@@ -2025,53 +1830,32 @@
|
|||||||
"public.source": {
|
"public.source": {
|
||||||
"name": "source",
|
"name": "source",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["trello"]
|
||||||
"trello"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.status": {
|
"public.status": {
|
||||||
"name": "status",
|
"name": "status",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["started", "success", "failed"]
|
||||||
"started",
|
|
||||||
"success",
|
|
||||||
"failed"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.role": {
|
"public.role": {
|
||||||
"name": "role",
|
"name": "role",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["admin", "member", "guest"]
|
||||||
"admin",
|
|
||||||
"member",
|
|
||||||
"guest"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.member_status": {
|
"public.member_status": {
|
||||||
"name": "member_status",
|
"name": "member_status",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["invited", "active", "removed"]
|
||||||
"invited",
|
|
||||||
"active",
|
|
||||||
"removed"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.slug_type": {
|
"public.slug_type": {
|
||||||
"name": "slug_type",
|
"name": "slug_type",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["reserved", "premium"]
|
||||||
"reserved",
|
|
||||||
"premium"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"public.workspace_plan": {
|
"public.workspace_plan": {
|
||||||
"name": "workspace_plan",
|
"name": "workspace_plan",
|
||||||
"schema": "public",
|
"schema": "public",
|
||||||
"values": [
|
"values": ["free", "pro", "enterprise"]
|
||||||
"free",
|
|
||||||
"pro",
|
|
||||||
"enterprise"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"schemas": {},
|
"schemas": {},
|
||||||
@@ -2084,4 +1868,4 @@
|
|||||||
"schemas": {},
|
"schemas": {},
|
||||||
"tables": {}
|
"tables": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2415
packages/db/migrations/meta/20250715123447_snapshot.json
Normal file
2415
packages/db/migrations/meta/20250715123447_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -50,6 +50,13 @@
|
|||||||
"when": 1749585889984,
|
"when": 1749585889984,
|
||||||
"tag": "20250610200449_ReaddIntegrationTable",
|
"tag": "20250610200449_ReaddIntegrationTable",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 7,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1752582887553,
|
||||||
|
"tag": "20250715123447_AddCardChecklists",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
varchar,
|
varchar,
|
||||||
} from "drizzle-orm/pg-core";
|
} from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
|
import { checklists } from "./checklists";
|
||||||
import { imports } from "./imports";
|
import { imports } from "./imports";
|
||||||
import { labels } from "./labels";
|
import { labels } from "./labels";
|
||||||
import { lists } from "./lists";
|
import { lists } from "./lists";
|
||||||
@@ -84,6 +85,7 @@ export const cardsRelations = relations(cards, ({ one, many }) => ({
|
|||||||
}),
|
}),
|
||||||
comments: many(comments),
|
comments: many(comments),
|
||||||
activities: many(cardActivities),
|
activities: many(cardActivities),
|
||||||
|
checklists: many(checklists),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const cardActivities = pgTable("card_activity", {
|
export const cardActivities = pgTable("card_activity", {
|
||||||
|
|||||||
90
packages/db/src/schema/checklists.ts
Normal file
90
packages/db/src/schema/checklists.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import { relations } from "drizzle-orm";
|
||||||
|
import {
|
||||||
|
bigint,
|
||||||
|
bigserial,
|
||||||
|
boolean,
|
||||||
|
integer,
|
||||||
|
pgTable,
|
||||||
|
timestamp,
|
||||||
|
uuid,
|
||||||
|
varchar,
|
||||||
|
} from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
|
import { cards } from "./cards";
|
||||||
|
import { users } from "./users";
|
||||||
|
|
||||||
|
export const checklists = pgTable("card_checklist", {
|
||||||
|
id: bigserial("id", { mode: "number" }).primaryKey(),
|
||||||
|
publicId: varchar("publicId", { length: 12 }).notNull().unique(),
|
||||||
|
title: varchar("title", { length: 255 }).notNull(),
|
||||||
|
index: integer("index").notNull(),
|
||||||
|
cardId: bigint("cardId", { mode: "number" })
|
||||||
|
.notNull()
|
||||||
|
.references(() => cards.id, { onDelete: "cascade" }),
|
||||||
|
createdBy: uuid("createdBy").references(() => users.id, {
|
||||||
|
onDelete: "set null",
|
||||||
|
}),
|
||||||
|
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||||
|
updatedAt: timestamp("updatedAt"),
|
||||||
|
deletedAt: timestamp("deletedAt"),
|
||||||
|
deletedBy: uuid("deletedBy").references(() => users.id, {
|
||||||
|
onDelete: "set null",
|
||||||
|
}),
|
||||||
|
}).enableRLS();
|
||||||
|
|
||||||
|
export const checklistsRelations = relations(checklists, ({ one, many }) => ({
|
||||||
|
card: one(cards, {
|
||||||
|
fields: [checklists.cardId],
|
||||||
|
references: [cards.id],
|
||||||
|
relationName: "checklistsCard",
|
||||||
|
}),
|
||||||
|
createdBy: one(users, {
|
||||||
|
fields: [checklists.createdBy],
|
||||||
|
references: [users.id],
|
||||||
|
relationName: "checklistsCreatedByUser",
|
||||||
|
}),
|
||||||
|
deletedBy: one(users, {
|
||||||
|
fields: [checklists.deletedBy],
|
||||||
|
references: [users.id],
|
||||||
|
relationName: "checklistsDeletedByUser",
|
||||||
|
}),
|
||||||
|
items: many(checklistItems),
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const checklistItems = pgTable("card_checklist_item", {
|
||||||
|
id: bigserial("id", { mode: "number" }).primaryKey(),
|
||||||
|
publicId: varchar("publicId", { length: 12 }).notNull().unique(),
|
||||||
|
title: varchar("title", { length: 500 }).notNull(),
|
||||||
|
completed: boolean("completed").notNull().default(false),
|
||||||
|
index: integer("index").notNull(),
|
||||||
|
checklistId: bigint("checklistId", { mode: "number" })
|
||||||
|
.notNull()
|
||||||
|
.references(() => checklists.id, { onDelete: "cascade" }),
|
||||||
|
createdBy: uuid("createdBy").references(() => users.id, {
|
||||||
|
onDelete: "set null",
|
||||||
|
}),
|
||||||
|
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||||
|
updatedAt: timestamp("updatedAt"),
|
||||||
|
deletedAt: timestamp("deletedAt"),
|
||||||
|
deletedBy: uuid("deletedBy").references(() => users.id, {
|
||||||
|
onDelete: "set null",
|
||||||
|
}),
|
||||||
|
}).enableRLS();
|
||||||
|
|
||||||
|
export const checklistItemsRelations = relations(checklistItems, ({ one }) => ({
|
||||||
|
checklist: one(checklists, {
|
||||||
|
fields: [checklistItems.checklistId],
|
||||||
|
references: [checklists.id],
|
||||||
|
relationName: "checklistItemsChecklist",
|
||||||
|
}),
|
||||||
|
createdBy: one(users, {
|
||||||
|
fields: [checklistItems.createdBy],
|
||||||
|
references: [users.id],
|
||||||
|
relationName: "checklistItemsCreatedByUser",
|
||||||
|
}),
|
||||||
|
deletedBy: one(users, {
|
||||||
|
fields: [checklistItems.deletedBy],
|
||||||
|
references: [users.id],
|
||||||
|
relationName: "checklistItemsDeletedByUser",
|
||||||
|
}),
|
||||||
|
}));
|
||||||
@@ -2,6 +2,7 @@ export * from "./auth";
|
|||||||
export * from "./boards";
|
export * from "./boards";
|
||||||
export * from "./auth";
|
export * from "./auth";
|
||||||
export * from "./cards";
|
export * from "./cards";
|
||||||
|
export * from "./checklists";
|
||||||
export * from "./feedback";
|
export * from "./feedback";
|
||||||
export * from "./imports";
|
export * from "./imports";
|
||||||
export * from "./labels";
|
export * from "./labels";
|
||||||
|
|||||||
Reference in New Issue
Block a user