diff --git a/apps/web/src/components/DateSelector.tsx b/apps/web/src/components/DateSelector.tsx index 71dd9389..56ce698f 100644 --- a/apps/web/src/components/DateSelector.tsx +++ b/apps/web/src/components/DateSelector.tsx @@ -17,9 +17,14 @@ import { twMerge } from "tailwind-merge"; interface DateSelectorProps { selectedDate?: Date | null; onDateSelect?: (date: Date | undefined) => void; + weekStartsOn?: 0 | 1 | 6; } -const DateSelector = ({ selectedDate, onDateSelect }: DateSelectorProps) => { +const DateSelector = ({ + selectedDate, + onDateSelect, + weekStartsOn = 1, +}: DateSelectorProps) => { const [currentMonth, setCurrentMonth] = useState(() => { return selectedDate ? startOfMonth(selectedDate) : startOfMonth(new Date()); }); @@ -28,18 +33,18 @@ const DateSelector = ({ selectedDate, onDateSelect }: DateSelectorProps) => { const year = format(currentMonth, "yyyy"); const dayHeaders = useMemo(() => { - const weekStart = startOfWeek(new Date(), { weekStartsOn: 1 }); // Monday + const weekStart = startOfWeek(new Date(), { weekStartsOn }); return eachDayOfInterval({ start: weekStart, end: new Date(weekStart.getTime() + 6 * 24 * 60 * 60 * 1000), }).map((date) => format(date, "EEEEEE")); // Shortest localized day name - }, []); + }, [weekStartsOn]); const days = useMemo(() => { const monthStart = startOfMonth(currentMonth); const monthEnd = endOfMonth(currentMonth); - const calendarStart = startOfWeek(monthStart, { weekStartsOn: 1 }); // Monday - const calendarEnd = endOfWeek(monthEnd, { weekStartsOn: 1 }); // Monday + const calendarStart = startOfWeek(monthStart, { weekStartsOn }); + const calendarEnd = endOfWeek(monthEnd, { weekStartsOn }); return eachDayOfInterval({ start: calendarStart, end: calendarEnd }).map( (date) => { @@ -53,7 +58,7 @@ const DateSelector = ({ selectedDate, onDateSelect }: DateSelectorProps) => { }; }, ); - }, [currentMonth, selectedDate]); + }, [currentMonth, selectedDate, weekStartsOn]); const handlePreviousMonth = () => { setCurrentMonth(subMonths(currentMonth, 1)); diff --git a/apps/web/src/components/NewWorkspaceForm.tsx b/apps/web/src/components/NewWorkspaceForm.tsx index 9c389c30..acc3c44e 100644 --- a/apps/web/src/components/NewWorkspaceForm.tsx +++ b/apps/web/src/components/NewWorkspaceForm.tsx @@ -111,6 +111,7 @@ export function NewWorkspaceForm() { slug: values.slug, plan: values.plan, role: "admin", + weekStartDay: 1, }); // If in cloud and Pro toggle is enabled, create checkout session for pro diff --git a/apps/web/src/providers/workspace.tsx b/apps/web/src/providers/workspace.tsx index 7f0c00a0..83e93930 100644 --- a/apps/web/src/providers/workspace.tsx +++ b/apps/web/src/providers/workspace.tsx @@ -19,6 +19,7 @@ interface Workspace { slug: string | undefined; plan: "free" | "pro" | "enterprise" | undefined; role: "admin" | "member" | "guest"; + weekStartDay: 0 | 1 | 6; } const initialWorkspace: Workspace = { @@ -28,13 +29,14 @@ const initialWorkspace: Workspace = { slug: "", plan: "free", role: "member", + weekStartDay: 1, }; const initialAvailableWorkspaces: Workspace[] = []; -export const WorkspaceContext = createContext( - undefined, -); +export const WorkspaceContext = createContext< + WorkspaceContextProps | undefined +>(undefined); export const WorkspaceProvider: React.FC<{ children: ReactNode }> = ({ children, @@ -79,6 +81,7 @@ export const WorkspaceProvider: React.FC<{ children: ReactNode }> = ({ slug: workspace.slug, description: workspace.description, plan: workspace.plan, + weekStartDay: workspace.weekStartDay, hasLoaded: true, })) as Workspace[]; @@ -100,6 +103,7 @@ export const WorkspaceProvider: React.FC<{ children: ReactNode }> = ({ plan: selectedWorkspace.workspace.plan, description: selectedWorkspace.workspace.description, role: selectedWorkspace.role, + weekStartDay: selectedWorkspace.workspace.weekStartDay as 0 | 1 | 6, }); if (workspacePublicId) { @@ -119,6 +123,7 @@ export const WorkspaceProvider: React.FC<{ children: ReactNode }> = ({ plan: primaryWorkspace.plan, description: primaryWorkspace.description, role: primaryWorkspaceRole, + weekStartDay: primaryWorkspace.weekStartDay as 0 | 1 | 6, }); } }, [data, isLoading, workspacePublicId, router]); diff --git a/apps/web/src/views/board/components/NewCardForm.tsx b/apps/web/src/views/board/components/NewCardForm.tsx index ce2c8dfb..e7678374 100644 --- a/apps/web/src/views/board/components/NewCardForm.tsx +++ b/apps/web/src/views/board/components/NewCardForm.tsx @@ -24,6 +24,7 @@ import Toggle from "~/components/Toggle"; import { useModalFormState } from "~/hooks/useModalFormState"; import { useModal } from "~/providers/modal"; import { usePopup } from "~/providers/popup"; +import { useWorkspace } from "~/providers/workspace"; import { api } from "~/utils/api"; import { formatMemberDisplayName, getAvatarUrl } from "~/utils/helpers"; @@ -53,6 +54,7 @@ export function NewCardForm({ queryParams, }: NewCardFormProps) { const { showPopup } = usePopup(); + const { workspace } = useWorkspace(); const { closeModal, openModal, modalStates, clearModalState } = useModal(); const utils = api.useUtils(); @@ -491,6 +493,7 @@ export function NewCardForm({ setValue("dueDate", date ?? null); setIsDateSelectorOpen(false); }} + weekStartsOn={workspace.weekStartDay} /> diff --git a/apps/web/src/views/card/components/DueDateSelector.tsx b/apps/web/src/views/card/components/DueDateSelector.tsx index 5ee935e6..5c320347 100644 --- a/apps/web/src/views/card/components/DueDateSelector.tsx +++ b/apps/web/src/views/card/components/DueDateSelector.tsx @@ -5,6 +5,7 @@ import { HiMiniPlus } from "react-icons/hi2"; import DateSelector from "~/components/DateSelector"; import { usePopup } from "~/providers/popup"; +import { useWorkspace } from "~/providers/workspace"; import { api } from "~/utils/api"; import { invalidateCard } from "~/utils/cardInvalidation"; @@ -22,6 +23,7 @@ export function DueDateSelector({ disabled = false, }: DueDateSelectorProps) { const { showPopup } = usePopup(); + const { workspace } = useWorkspace(); const utils = api.useUtils(); const [isOpen, setIsOpen] = useState(false); const [pendingDate, setPendingDate] = useState( @@ -135,6 +137,7 @@ export function DueDateSelector({ diff --git a/apps/web/src/views/settings/WorkspaceSettings.tsx b/apps/web/src/views/settings/WorkspaceSettings.tsx index 008f89d7..54d5d4a3 100644 --- a/apps/web/src/views/settings/WorkspaceSettings.tsx +++ b/apps/web/src/views/settings/WorkspaceSettings.tsx @@ -21,6 +21,7 @@ import UpdateWorkspaceDescriptionForm from "./components/UpdateWorkspaceDescript import UpdateWorkspaceEmailVisibilityForm from "./components/UpdateWorkspaceEmailVisibilityForm"; import UpdateWorkspaceNameForm from "./components/UpdateWorkspaceNameForm"; import UpdateWorkspaceUrlForm from "./components/UpdateWorkspaceUrlForm"; +import UpdateWeekStartDayForm from "./components/UpdateWeekStartDayForm"; import { UpgradeToProConfirmation } from "./components/UpgradeToProConfirmation"; export default function WorkspaceSettings() { @@ -86,6 +87,15 @@ export default function WorkspaceSettings() { disabled={!canEditWorkspace} /> +

+ {t`Week start day`} +

+ +

{t`Email visibility`}

diff --git a/apps/web/src/views/settings/components/UpdateWeekStartDayForm.tsx b/apps/web/src/views/settings/components/UpdateWeekStartDayForm.tsx new file mode 100644 index 00000000..af0b13d7 --- /dev/null +++ b/apps/web/src/views/settings/components/UpdateWeekStartDayForm.tsx @@ -0,0 +1,59 @@ +import { t } from "@lingui/core/macro"; +import { useEffect, useState } from "react"; + +import { api } from "~/utils/api"; + +export default function UpdateWeekStartDayForm({ + workspacePublicId, + weekStartDay, + disabled = false, +}: { + workspacePublicId: string; + weekStartDay: number; + disabled?: boolean; +}) { + const utils = api.useUtils(); + const [value, setValue] = useState(weekStartDay); + + useEffect(() => { + setValue(weekStartDay); + }, [weekStartDay]); + + const updateWorkspace = api.workspace.update.useMutation({ + onSuccess: () => { + if (workspacePublicId && workspacePublicId.length >= 12) { + void utils.workspace.byId.invalidate({ + workspacePublicId, + }); + void utils.workspace.all.invalidate(); + } + }, + }); + + const handleChange = (e: React.ChangeEvent) => { + if (disabled) return; + const newValue = Number(e.target.value); + setValue(newValue); + updateWorkspace.mutate({ + workspacePublicId, + weekStartDay: newValue, + }); + }; + + return ( +
+
+ +
+
+ ); +} diff --git a/packages/api/src/routers/workspace.ts b/packages/api/src/routers/workspace.ts index f0531f91..61a67748 100644 --- a/packages/api/src/routers/workspace.ts +++ b/packages/api/src/routers/workspace.ts @@ -4,11 +4,10 @@ import { z } from "zod"; import * as workspaceRepo from "@kan/db/repository/workspace.repo"; import * as workspaceSlugRepo from "@kan/db/repository/workspaceSlug.repo"; -import { generateUID } from "@kan/shared/utils"; +import { generateAvatarUrl, generateUID } from "@kan/shared/utils"; import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc"; import { assertPermission } from "../utils/permissions"; -import { generateAvatarUrl } from "@kan/shared/utils"; export const workspaceRouter = createTRPCRouter({ all: protectedProcedure @@ -84,8 +83,7 @@ export const workspaceRouter = createTRPCRouter({ const isAdmin = userMember?.role === "admin"; // Show emails if user is admin OR workspace setting allows it - const shouldShowEmails = - isAdmin || result.showEmailsToMembers === true; + const shouldShowEmails = isAdmin || result.showEmailsToMembers === true; // Generate presigned URLs for member avatars const membersWithAvatarUrls = await Promise.all( @@ -295,6 +293,9 @@ export const workspaceRouter = createTRPCRouter({ .optional(), description: z.string().min(3).max(280).optional(), showEmailsToMembers: z.boolean().optional(), + weekStartDay: z + .union([z.literal(0), z.literal(1), z.literal(6)]) + .optional(), }), ) .output(z.custom>>()) @@ -356,6 +357,7 @@ export const workspaceRouter = createTRPCRouter({ slug: input.slug, description: input.description, showEmailsToMembers: input.showEmailsToMembers, + weekStartDay: input.weekStartDay, }, ); diff --git a/packages/api/src/utils/webhook.ts b/packages/api/src/utils/webhook.ts index a3583a2f..5838e827 100644 --- a/packages/api/src/utils/webhook.ts +++ b/packages/api/src/utils/webhook.ts @@ -190,7 +190,7 @@ export async function sendWebhooksForWorkspace( db, workspaceId, ); - const webhooks = allWebhooks.filter((w) => + const webhooksForEvent = allWebhooks.filter((w) => w.events.includes(payload.event), ); diff --git a/packages/db/migrations/20260311065722_AddWeekStartDay.sql b/packages/db/migrations/20260311065722_AddWeekStartDay.sql new file mode 100644 index 00000000..1150e4cd --- /dev/null +++ b/packages/db/migrations/20260311065722_AddWeekStartDay.sql @@ -0,0 +1,52 @@ +-- Migrations and snapshots seem to have become out of sync (this should fix that) +DO $$ +BEGIN + IF NOT EXISTS ( + SELECT 1 + FROM pg_enum e + JOIN pg_type t ON e.enumtypid = t.oid + WHERE t.typname = 'source' + AND e.enumlabel = 'github' + ) THEN + ALTER TYPE "public"."source" ADD VALUE 'github'; + END IF; +END $$; +--> statement-breakpoint +CREATE TABLE IF NOT EXISTS "workspace_webhooks" ( + "id" bigserial PRIMARY KEY NOT NULL, + "publicId" varchar(12) NOT NULL, + "workspaceId" bigint NOT NULL, + "name" varchar(255) NOT NULL, + "url" varchar(2048) NOT NULL, + "secret" text, + "events" text NOT NULL, + "active" boolean DEFAULT true NOT NULL, + "createdBy" uuid NOT NULL, + "createdAt" timestamp DEFAULT now() NOT NULL, + "updatedAt" timestamp, + CONSTRAINT "workspace_webhooks_publicId_unique" UNIQUE("publicId") +); +--> statement-breakpoint +ALTER TABLE "workspace_webhooks" ENABLE ROW LEVEL SECURITY;--> statement-breakpoint +ALTER TABLE "integration" ALTER COLUMN "accessToken" SET DATA TYPE text;--> statement-breakpoint +ALTER TABLE "card_activity" ADD COLUMN IF NOT EXISTS "attachmentId" bigint;--> statement-breakpoint +--> statement-breakpoint +ALTER TABLE "workspace" ADD COLUMN IF NOT EXISTS "weekStartDay" integer DEFAULT 1 NOT NULL;--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "workspace_webhooks" ADD CONSTRAINT "workspace_webhooks_workspaceId_workspace_id_fk" FOREIGN KEY ("workspaceId") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "workspace_webhooks" ADD CONSTRAINT "workspace_webhooks_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; +--> statement-breakpoint +CREATE INDEX IF NOT EXISTS "workspace_webhooks_workspace_idx" ON "workspace_webhooks" USING btree ("workspaceId");--> statement-breakpoint +DO $$ BEGIN + ALTER TABLE "card_activity" ADD CONSTRAINT "card_activity_attachmentId_card_attachment_id_fk" FOREIGN KEY ("attachmentId") REFERENCES "public"."card_attachment"("id") ON DELETE cascade ON UPDATE no action; +EXCEPTION + WHEN duplicate_object THEN null; +END $$; diff --git a/packages/db/migrations/meta/20260208033314_snapshot.json b/packages/db/migrations/meta/20260208033314_snapshot.json index 0b8a0f5a..8125ed76 100644 --- a/packages/db/migrations/meta/20260208033314_snapshot.json +++ b/packages/db/migrations/meta/20260208033314_snapshot.json @@ -1,6 +1,6 @@ { "id": "d0ce9209-d34a-4ae8-b93e-d73391bfec64", - "prevId": "3d6e154d-19ee-4e43-8b74-954a644f70d2", + "prevId": "99b49af4-cc01-43ef-9d34-de8a49a61573", "version": "7", "dialect": "postgresql", "tables": { @@ -93,12 +93,8 @@ "name": "account_userId_user_id_fk", "tableFrom": "account", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -246,12 +242,8 @@ "name": "apiKey_userId_user_id_fk", "tableFrom": "apiKey", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -321,12 +313,8 @@ "name": "session_userId_user_id_fk", "tableFrom": "session", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -336,9 +324,7 @@ "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, - "columns": [ - "token" - ] + "columns": ["token"] } }, "policies": {}, @@ -568,12 +554,8 @@ "name": "board_createdBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -581,12 +563,8 @@ "name": "board_deletedBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -594,12 +572,8 @@ "name": "board_importId_import_id_fk", "tableFrom": "board", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -607,12 +581,8 @@ "name": "board_workspaceId_workspace_id_fk", "tableFrom": "board", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -622,9 +592,7 @@ "board_publicId_unique": { "name": "board_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -692,12 +660,8 @@ "name": "user_board_favorites_userId_user_id_fk", "tableFrom": "user_board_favorites", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -705,12 +669,8 @@ "name": "user_board_favorites_boardId_board_id_fk", "tableFrom": "user_board_favorites", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -718,10 +678,7 @@ "compositePrimaryKeys": { "user_board_favorites_userId_boardId_pk": { "name": "user_board_favorites_userId_boardId_pk", - "columns": [ - "userId", - "boardId" - ] + "columns": ["userId", "boardId"] } }, "uniqueConstraints": {}, @@ -880,12 +837,8 @@ "name": "card_activity_cardId_card_id_fk", "tableFrom": "card_activity", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -893,12 +846,8 @@ "name": "card_activity_fromListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["fromListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -906,12 +855,8 @@ "name": "card_activity_toListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["toListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -919,12 +864,8 @@ "name": "card_activity_labelId_label_id_fk", "tableFrom": "card_activity", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -932,12 +873,8 @@ "name": "card_activity_workspaceMemberId_workspace_members_id_fk", "tableFrom": "card_activity", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -945,12 +882,8 @@ "name": "card_activity_createdBy_user_id_fk", "tableFrom": "card_activity", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -958,12 +891,8 @@ "name": "card_activity_commentId_card_comments_id_fk", "tableFrom": "card_activity", "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["commentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -971,12 +900,8 @@ "name": "card_activity_sourceBoardId_board_id_fk", "tableFrom": "card_activity", "tableTo": "board", - "columnsFrom": [ - "sourceBoardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["sourceBoardId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -984,12 +909,8 @@ "name": "card_activity_attachmentId_card_attachment_id_fk", "tableFrom": "card_activity", "tableTo": "card_attachment", - "columnsFrom": [ - "attachmentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["attachmentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -999,9 +920,7 @@ "card_activity_publicId_unique": { "name": "card_activity_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1086,12 +1005,8 @@ "name": "card_attachment_cardId_card_id_fk", "tableFrom": "card_attachment", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1099,12 +1014,8 @@ "name": "card_attachment_createdBy_user_id_fk", "tableFrom": "card_attachment", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1114,9 +1025,7 @@ "card_attachment_publicId_unique": { "name": "card_attachment_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1146,12 +1055,8 @@ "name": "_card_workspace_members_cardId_card_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1159,12 +1064,8 @@ "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1172,10 +1073,7 @@ "compositePrimaryKeys": { "_card_workspace_members_cardId_workspaceMemberId_pk": { "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] + "columns": ["cardId", "workspaceMemberId"] } }, "uniqueConstraints": {}, @@ -1273,12 +1171,8 @@ "name": "card_createdBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1286,12 +1180,8 @@ "name": "card_deletedBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1299,12 +1189,8 @@ "name": "card_listId_list_id_fk", "tableFrom": "card", "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["listId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1312,12 +1198,8 @@ "name": "card_importId_import_id_fk", "tableFrom": "card", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1327,9 +1209,7 @@ "card_publicId_unique": { "name": "card_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1359,12 +1239,8 @@ "name": "_card_labels_cardId_card_id_fk", "tableFrom": "_card_labels", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1372,12 +1248,8 @@ "name": "_card_labels_labelId_label_id_fk", "tableFrom": "_card_labels", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1385,10 +1257,7 @@ "compositePrimaryKeys": { "_card_labels_cardId_labelId_pk": { "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] + "columns": ["cardId", "labelId"] } }, "uniqueConstraints": {}, @@ -1462,12 +1331,8 @@ "name": "card_comments_cardId_card_id_fk", "tableFrom": "card_comments", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1475,12 +1340,8 @@ "name": "card_comments_createdBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1488,12 +1349,8 @@ "name": "card_comments_deletedBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1503,9 +1360,7 @@ "card_comments_publicId_unique": { "name": "card_comments_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1591,12 +1446,8 @@ "name": "card_checklist_item_checklistId_card_checklist_id_fk", "tableFrom": "card_checklist_item", "tableTo": "card_checklist", - "columnsFrom": [ - "checklistId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["checklistId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1604,12 +1455,8 @@ "name": "card_checklist_item_createdBy_user_id_fk", "tableFrom": "card_checklist_item", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1617,12 +1464,8 @@ "name": "card_checklist_item_deletedBy_user_id_fk", "tableFrom": "card_checklist_item", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1632,9 +1475,7 @@ "card_checklist_item_publicId_unique": { "name": "card_checklist_item_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1713,12 +1554,8 @@ "name": "card_checklist_cardId_card_id_fk", "tableFrom": "card_checklist", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1726,12 +1563,8 @@ "name": "card_checklist_createdBy_user_id_fk", "tableFrom": "card_checklist", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1739,12 +1572,8 @@ "name": "card_checklist_deletedBy_user_id_fk", "tableFrom": "card_checklist", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1754,9 +1583,7 @@ "card_checklist_publicId_unique": { "name": "card_checklist_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1818,12 +1645,8 @@ "name": "feedback_createdBy_user_id_fk", "tableFrom": "feedback", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1884,12 +1707,8 @@ "name": "import_createdBy_user_id_fk", "tableFrom": "import", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1899,9 +1718,7 @@ "import_publicId_unique": { "name": "import_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1986,12 +1803,8 @@ "name": "label_createdBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1999,12 +1812,8 @@ "name": "label_boardId_board_id_fk", "tableFrom": "label", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2012,12 +1821,8 @@ "name": "label_importId_import_id_fk", "tableFrom": "label", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -2025,12 +1830,8 @@ "name": "label_deletedBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2040,9 +1841,7 @@ "label_publicId_unique": { "name": "label_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2127,12 +1926,8 @@ "name": "list_createdBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2140,12 +1935,8 @@ "name": "list_deletedBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2153,12 +1944,8 @@ "name": "list_boardId_board_id_fk", "tableFrom": "list", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2166,12 +1953,8 @@ "name": "list_importId_import_id_fk", "tableFrom": "list", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -2181,9 +1964,7 @@ "list_publicId_unique": { "name": "list_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2253,9 +2034,7 @@ "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, - "columns": [ - "email" - ] + "columns": ["email"] } }, "policies": {}, @@ -2315,12 +2094,8 @@ "name": "integration_userId_user_id_fk", "tableFrom": "integration", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2328,10 +2103,7 @@ "compositePrimaryKeys": { "integration_pkey": { "name": "integration_pkey", - "columns": [ - "userId", - "provider" - ] + "columns": ["userId", "provider"] } }, "uniqueConstraints": {}, @@ -2393,12 +2165,8 @@ "name": "workspace_slug_checks_workspaceId_workspace_id_fk", "tableFrom": "workspace_slug_checks", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -2406,12 +2174,8 @@ "name": "workspace_slug_checks_createdBy_user_id_fk", "tableFrom": "workspace_slug_checks", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2447,9 +2211,7 @@ "workspace_slugs_slug_unique": { "name": "workspace_slugs_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -2549,12 +2311,8 @@ "name": "workspace_members_userId_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2562,12 +2320,8 @@ "name": "workspace_members_workspaceId_workspace_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2575,12 +2329,8 @@ "name": "workspace_members_deletedBy_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2588,12 +2338,8 @@ "name": "workspace_members_roleId_workspace_roles_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace_roles", - "columnsFrom": [ - "roleId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["roleId"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "no action" } @@ -2603,9 +2349,7 @@ "workspace_members_publicId_unique": { "name": "workspace_members_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2699,12 +2443,8 @@ "name": "workspace_createdBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2712,12 +2452,8 @@ "name": "workspace_deletedBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2727,16 +2463,12 @@ "workspace_publicId_unique": { "name": "workspace_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_slug_unique": { "name": "workspace_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -2847,12 +2579,8 @@ "name": "subscription_referenceId_workspace_publicId_fk", "tableFrom": "subscription", "tableTo": "workspace", - "columnsFrom": [ - "referenceId" - ], - "columnsTo": [ - "publicId" - ], + "columnsFrom": ["referenceId"], + "columnsTo": ["publicId"], "onDelete": "set null", "onUpdate": "no action" } @@ -2937,12 +2665,8 @@ "name": "workspace_invite_links_workspaceId_workspace_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2950,12 +2674,8 @@ "name": "workspace_invite_links_createdBy_user_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2963,12 +2683,8 @@ "name": "workspace_invite_links_updatedBy_user_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "user", - "columnsFrom": [ - "updatedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["updatedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2978,16 +2694,12 @@ "workspace_invite_links_publicId_unique": { "name": "workspace_invite_links_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_invite_links_code_unique": { "name": "workspace_invite_links_code_unique", "nullsNotDistinct": false, - "columns": [ - "code" - ] + "columns": ["code"] } }, "policies": {}, @@ -3162,12 +2874,8 @@ "name": "workspace_role_permissions_workspaceRoleId_workspace_roles_id_fk", "tableFrom": "workspace_role_permissions", "tableTo": "workspace_roles", - "columnsFrom": [ - "workspaceRoleId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceRoleId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3282,12 +2990,8 @@ "name": "workspace_roles_workspaceId_workspace_id_fk", "tableFrom": "workspace_roles", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3297,9 +3001,7 @@ "workspace_roles_publicId_unique": { "name": "workspace_roles_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -3311,18 +3013,12 @@ "public.board_type": { "name": "board_type", "schema": "public", - "values": [ - "regular", - "template" - ] + "values": ["regular", "template"] }, "public.board_visibility": { "name": "board_visibility", "schema": "public", - "values": [ - "private", - "public" - ] + "values": ["private", "public"] }, "public.card_activity_type": { "name": "card_activity_type", @@ -3359,62 +3055,37 @@ "public.source": { "name": "source", "schema": "public", - "values": [ - "trello" - ] + "values": ["trello"] }, "public.status": { "name": "status", "schema": "public", - "values": [ - "started", - "success", - "failed" - ] + "values": ["started", "success", "failed"] }, "public.role": { "name": "role", "schema": "public", - "values": [ - "admin", - "member", - "guest" - ] + "values": ["admin", "member", "guest"] }, "public.member_status": { "name": "member_status", "schema": "public", - "values": [ - "invited", - "active", - "removed", - "paused" - ] + "values": ["invited", "active", "removed", "paused"] }, "public.slug_type": { "name": "slug_type", "schema": "public", - "values": [ - "reserved", - "premium" - ] + "values": ["reserved", "premium"] }, "public.workspace_plan": { "name": "workspace_plan", "schema": "public", - "values": [ - "free", - "pro", - "enterprise" - ] + "values": ["free", "pro", "enterprise"] }, "public.invite_link_status": { "name": "invite_link_status", "schema": "public", - "values": [ - "active", - "inactive" - ] + "values": ["active", "inactive"] } }, "schemas": {}, @@ -3427,4 +3098,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/migrations/meta/20260224105235_snapshot.json b/packages/db/migrations/meta/20260224105235_snapshot.json index c3f16818..17a55312 100644 --- a/packages/db/migrations/meta/20260224105235_snapshot.json +++ b/packages/db/migrations/meta/20260224105235_snapshot.json @@ -1,6 +1,6 @@ { "id": "dc863226-583e-4985-8b6a-4c360a3b9fa1", - "prevId": "4e1ebb8b-bd52-48c5-87d6-8e6e5eb8bbde", + "prevId": "d0ce9209-d34a-4ae8-b93e-d73391bfec64", "version": "7", "dialect": "postgresql", "tables": { diff --git a/packages/db/migrations/meta/20260225195947_snapshot.json b/packages/db/migrations/meta/20260225195947_snapshot.json index cf9dd65e..0ff49671 100644 --- a/packages/db/migrations/meta/20260225195947_snapshot.json +++ b/packages/db/migrations/meta/20260225195947_snapshot.json @@ -1,6 +1,6 @@ { "id": "7bd48a47-95eb-46ea-9d19-cd80b44a3283", - "prevId": "99b49af4-cc01-43ef-9d34-de8a49a61573", + "prevId": "dc863226-583e-4985-8b6a-4c360a3b9fa1", "version": "7", "dialect": "postgresql", "tables": { @@ -93,12 +93,8 @@ "name": "account_userId_user_id_fk", "tableFrom": "account", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -246,12 +242,8 @@ "name": "apiKey_userId_user_id_fk", "tableFrom": "apiKey", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -321,12 +313,8 @@ "name": "session_userId_user_id_fk", "tableFrom": "session", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -336,9 +324,7 @@ "session_token_unique": { "name": "session_token_unique", "nullsNotDistinct": false, - "columns": [ - "token" - ] + "columns": ["token"] } }, "policies": {}, @@ -590,12 +576,8 @@ "name": "board_createdBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -603,12 +585,8 @@ "name": "board_deletedBy_user_id_fk", "tableFrom": "board", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -616,12 +594,8 @@ "name": "board_importId_import_id_fk", "tableFrom": "board", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -629,12 +603,8 @@ "name": "board_workspaceId_workspace_id_fk", "tableFrom": "board", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -644,9 +614,7 @@ "board_publicId_unique": { "name": "board_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -714,12 +682,8 @@ "name": "user_board_favorites_userId_user_id_fk", "tableFrom": "user_board_favorites", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -727,12 +691,8 @@ "name": "user_board_favorites_boardId_board_id_fk", "tableFrom": "user_board_favorites", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -740,10 +700,7 @@ "compositePrimaryKeys": { "user_board_favorites_userId_boardId_pk": { "name": "user_board_favorites_userId_boardId_pk", - "columns": [ - "userId", - "boardId" - ] + "columns": ["userId", "boardId"] } }, "uniqueConstraints": {}, @@ -896,12 +853,8 @@ "name": "card_activity_cardId_card_id_fk", "tableFrom": "card_activity", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -909,12 +862,8 @@ "name": "card_activity_fromListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "fromListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["fromListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -922,12 +871,8 @@ "name": "card_activity_toListId_list_id_fk", "tableFrom": "card_activity", "tableTo": "list", - "columnsFrom": [ - "toListId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["toListId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -935,12 +880,8 @@ "name": "card_activity_labelId_label_id_fk", "tableFrom": "card_activity", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -948,12 +889,8 @@ "name": "card_activity_workspaceMemberId_workspace_members_id_fk", "tableFrom": "card_activity", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -961,12 +898,8 @@ "name": "card_activity_createdBy_user_id_fk", "tableFrom": "card_activity", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -974,12 +907,8 @@ "name": "card_activity_commentId_card_comments_id_fk", "tableFrom": "card_activity", "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["commentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -987,12 +916,8 @@ "name": "card_activity_sourceBoardId_board_id_fk", "tableFrom": "card_activity", "tableTo": "board", - "columnsFrom": [ - "sourceBoardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["sourceBoardId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1002,9 +927,7 @@ "card_activity_publicId_unique": { "name": "card_activity_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1089,12 +1012,8 @@ "name": "card_attachment_cardId_card_id_fk", "tableFrom": "card_attachment", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1102,12 +1021,8 @@ "name": "card_attachment_createdBy_user_id_fk", "tableFrom": "card_attachment", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1117,9 +1032,7 @@ "card_attachment_publicId_unique": { "name": "card_attachment_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1149,12 +1062,8 @@ "name": "_card_workspace_members_cardId_card_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1162,12 +1071,8 @@ "name": "_card_workspace_members_workspaceMemberId_workspace_members_id_fk", "tableFrom": "_card_workspace_members", "tableTo": "workspace_members", - "columnsFrom": [ - "workspaceMemberId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceMemberId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1175,10 +1080,7 @@ "compositePrimaryKeys": { "_card_workspace_members_cardId_workspaceMemberId_pk": { "name": "_card_workspace_members_cardId_workspaceMemberId_pk", - "columns": [ - "cardId", - "workspaceMemberId" - ] + "columns": ["cardId", "workspaceMemberId"] } }, "uniqueConstraints": {}, @@ -1276,12 +1178,8 @@ "name": "card_createdBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1289,12 +1187,8 @@ "name": "card_deletedBy_user_id_fk", "tableFrom": "card", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1302,12 +1196,8 @@ "name": "card_listId_list_id_fk", "tableFrom": "card", "tableTo": "list", - "columnsFrom": [ - "listId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["listId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1315,12 +1205,8 @@ "name": "card_importId_import_id_fk", "tableFrom": "card", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -1330,9 +1216,7 @@ "card_publicId_unique": { "name": "card_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1362,12 +1246,8 @@ "name": "_card_labels_cardId_card_id_fk", "tableFrom": "_card_labels", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1375,12 +1255,8 @@ "name": "_card_labels_labelId_label_id_fk", "tableFrom": "_card_labels", "tableTo": "label", - "columnsFrom": [ - "labelId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["labelId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -1388,10 +1264,7 @@ "compositePrimaryKeys": { "_card_labels_cardId_labelId_pk": { "name": "_card_labels_cardId_labelId_pk", - "columns": [ - "cardId", - "labelId" - ] + "columns": ["cardId", "labelId"] } }, "uniqueConstraints": {}, @@ -1465,12 +1338,8 @@ "name": "card_comments_cardId_card_id_fk", "tableFrom": "card_comments", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1478,12 +1347,8 @@ "name": "card_comments_createdBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1491,12 +1356,8 @@ "name": "card_comments_deletedBy_user_id_fk", "tableFrom": "card_comments", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1506,9 +1367,7 @@ "card_comments_publicId_unique": { "name": "card_comments_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1594,12 +1453,8 @@ "name": "card_checklist_item_checklistId_card_checklist_id_fk", "tableFrom": "card_checklist_item", "tableTo": "card_checklist", - "columnsFrom": [ - "checklistId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["checklistId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1607,12 +1462,8 @@ "name": "card_checklist_item_createdBy_user_id_fk", "tableFrom": "card_checklist_item", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1620,12 +1471,8 @@ "name": "card_checklist_item_deletedBy_user_id_fk", "tableFrom": "card_checklist_item", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1635,9 +1482,7 @@ "card_checklist_item_publicId_unique": { "name": "card_checklist_item_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1716,12 +1561,8 @@ "name": "card_checklist_cardId_card_id_fk", "tableFrom": "card_checklist", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -1729,12 +1570,8 @@ "name": "card_checklist_createdBy_user_id_fk", "tableFrom": "card_checklist", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -1742,12 +1579,8 @@ "name": "card_checklist_deletedBy_user_id_fk", "tableFrom": "card_checklist", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1757,9 +1590,7 @@ "card_checklist_publicId_unique": { "name": "card_checklist_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1821,12 +1652,8 @@ "name": "feedback_createdBy_user_id_fk", "tableFrom": "feedback", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1887,12 +1714,8 @@ "name": "import_createdBy_user_id_fk", "tableFrom": "import", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -1902,9 +1725,7 @@ "import_publicId_unique": { "name": "import_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -1989,12 +1810,8 @@ "name": "label_createdBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2002,12 +1819,8 @@ "name": "label_boardId_board_id_fk", "tableFrom": "label", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2015,12 +1828,8 @@ "name": "label_importId_import_id_fk", "tableFrom": "label", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -2028,12 +1837,8 @@ "name": "label_deletedBy_user_id_fk", "tableFrom": "label", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2043,9 +1848,7 @@ "label_publicId_unique": { "name": "label_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2130,12 +1933,8 @@ "name": "list_createdBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2143,12 +1942,8 @@ "name": "list_deletedBy_user_id_fk", "tableFrom": "list", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2156,12 +1951,8 @@ "name": "list_boardId_board_id_fk", "tableFrom": "list", "tableTo": "board", - "columnsFrom": [ - "boardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["boardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2169,12 +1960,8 @@ "name": "list_importId_import_id_fk", "tableFrom": "list", "tableTo": "import", - "columnsFrom": [ - "importId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["importId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" } @@ -2184,9 +1971,7 @@ "list_publicId_unique": { "name": "list_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2256,9 +2041,7 @@ "user_email_unique": { "name": "user_email_unique", "nullsNotDistinct": false, - "columns": [ - "email" - ] + "columns": ["email"] } }, "policies": {}, @@ -2318,12 +2101,8 @@ "name": "integration_userId_user_id_fk", "tableFrom": "integration", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -2331,10 +2110,7 @@ "compositePrimaryKeys": { "integration_pkey": { "name": "integration_pkey", - "columns": [ - "userId", - "provider" - ] + "columns": ["userId", "provider"] } }, "uniqueConstraints": {}, @@ -2396,12 +2172,8 @@ "name": "workspace_slug_checks_workspaceId_workspace_id_fk", "tableFrom": "workspace_slug_checks", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "no action", "onUpdate": "no action" }, @@ -2409,12 +2181,8 @@ "name": "workspace_slug_checks_createdBy_user_id_fk", "tableFrom": "workspace_slug_checks", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2450,9 +2218,7 @@ "workspace_slugs_slug_unique": { "name": "workspace_slugs_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -2552,12 +2318,8 @@ "name": "workspace_members_userId_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2565,12 +2327,8 @@ "name": "workspace_members_workspaceId_workspace_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2578,12 +2336,8 @@ "name": "workspace_members_deletedBy_user_id_fk", "tableFrom": "workspace_members", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2591,12 +2345,8 @@ "name": "workspace_members_roleId_workspace_roles_id_fk", "tableFrom": "workspace_members", "tableTo": "workspace_roles", - "columnsFrom": [ - "roleId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["roleId"], + "columnsTo": ["id"], "onDelete": "restrict", "onUpdate": "no action" } @@ -2606,9 +2356,7 @@ "workspace_members_publicId_unique": { "name": "workspace_members_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -2702,12 +2450,8 @@ "name": "workspace_createdBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2715,12 +2459,8 @@ "name": "workspace_deletedBy_user_id_fk", "tableFrom": "workspace", "tableTo": "user", - "columnsFrom": [ - "deletedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["deletedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2730,16 +2470,12 @@ "workspace_publicId_unique": { "name": "workspace_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_slug_unique": { "name": "workspace_slug_unique", "nullsNotDistinct": false, - "columns": [ - "slug" - ] + "columns": ["slug"] } }, "policies": {}, @@ -2850,12 +2586,8 @@ "name": "subscription_referenceId_workspace_publicId_fk", "tableFrom": "subscription", "tableTo": "workspace", - "columnsFrom": [ - "referenceId" - ], - "columnsTo": [ - "publicId" - ], + "columnsFrom": ["referenceId"], + "columnsTo": ["publicId"], "onDelete": "set null", "onUpdate": "no action" } @@ -2940,12 +2672,8 @@ "name": "workspace_invite_links_workspaceId_workspace_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -2953,12 +2681,8 @@ "name": "workspace_invite_links_createdBy_user_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "user", - "columnsFrom": [ - "createdBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["createdBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" }, @@ -2966,12 +2690,8 @@ "name": "workspace_invite_links_updatedBy_user_id_fk", "tableFrom": "workspace_invite_links", "tableTo": "user", - "columnsFrom": [ - "updatedBy" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["updatedBy"], + "columnsTo": ["id"], "onDelete": "set null", "onUpdate": "no action" } @@ -2981,16 +2701,12 @@ "workspace_invite_links_publicId_unique": { "name": "workspace_invite_links_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] }, "workspace_invite_links_code_unique": { "name": "workspace_invite_links_code_unique", "nullsNotDistinct": false, - "columns": [ - "code" - ] + "columns": ["code"] } }, "policies": {}, @@ -3165,12 +2881,8 @@ "name": "workspace_role_permissions_workspaceRoleId_workspace_roles_id_fk", "tableFrom": "workspace_role_permissions", "tableTo": "workspace_roles", - "columnsFrom": [ - "workspaceRoleId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceRoleId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3285,12 +2997,8 @@ "name": "workspace_roles_workspaceId_workspace_id_fk", "tableFrom": "workspace_roles", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3300,9 +3008,7 @@ "workspace_roles_publicId_unique": { "name": "workspace_roles_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -3512,12 +3218,8 @@ "name": "notification_userId_user_id_fk", "tableFrom": "notification", "tableTo": "user", - "columnsFrom": [ - "userId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["userId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3525,12 +3227,8 @@ "name": "notification_cardId_card_id_fk", "tableFrom": "notification", "tableTo": "card", - "columnsFrom": [ - "cardId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["cardId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3538,12 +3236,8 @@ "name": "notification_commentId_card_comments_id_fk", "tableFrom": "notification", "tableTo": "card_comments", - "columnsFrom": [ - "commentId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["commentId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" }, @@ -3551,12 +3245,8 @@ "name": "notification_workspaceId_workspace_id_fk", "tableFrom": "notification", "tableTo": "workspace", - "columnsFrom": [ - "workspaceId" - ], - "columnsTo": [ - "id" - ], + "columnsFrom": ["workspaceId"], + "columnsTo": ["id"], "onDelete": "cascade", "onUpdate": "no action" } @@ -3566,9 +3256,7 @@ "notification_publicId_unique": { "name": "notification_publicId_unique", "nullsNotDistinct": false, - "columns": [ - "publicId" - ] + "columns": ["publicId"] } }, "policies": {}, @@ -3580,18 +3268,12 @@ "public.board_type": { "name": "board_type", "schema": "public", - "values": [ - "regular", - "template" - ] + "values": ["regular", "template"] }, "public.board_visibility": { "name": "board_visibility", "schema": "public", - "values": [ - "private", - "public" - ] + "values": ["private", "public"] }, "public.card_activity_type": { "name": "card_activity_type", @@ -3628,62 +3310,37 @@ "public.source": { "name": "source", "schema": "public", - "values": [ - "trello" - ] + "values": ["trello"] }, "public.status": { "name": "status", "schema": "public", - "values": [ - "started", - "success", - "failed" - ] + "values": ["started", "success", "failed"] }, "public.role": { "name": "role", "schema": "public", - "values": [ - "admin", - "member", - "guest" - ] + "values": ["admin", "member", "guest"] }, "public.member_status": { "name": "member_status", "schema": "public", - "values": [ - "invited", - "active", - "removed", - "paused" - ] + "values": ["invited", "active", "removed", "paused"] }, "public.slug_type": { "name": "slug_type", "schema": "public", - "values": [ - "reserved", - "premium" - ] + "values": ["reserved", "premium"] }, "public.workspace_plan": { "name": "workspace_plan", "schema": "public", - "values": [ - "free", - "pro", - "enterprise" - ] + "values": ["free", "pro", "enterprise"] }, "public.invite_link_status": { "name": "invite_link_status", "schema": "public", - "values": [ - "active", - "inactive" - ] + "values": ["active", "inactive"] }, "public.notification_type": { "name": "notification_type", @@ -3706,4 +3363,4 @@ "schemas": {}, "tables": {} } -} \ No newline at end of file +} diff --git a/packages/db/migrations/meta/20260311065722_snapshot.json b/packages/db/migrations/meta/20260311065722_snapshot.json new file mode 100644 index 00000000..3a94142e --- /dev/null +++ b/packages/db/migrations/meta/20260311065722_snapshot.json @@ -0,0 +1,3868 @@ +{ + "id": "c8acd64a-f67f-4119-8cf3-d98322744d50", + "prevId": "7bd48a47-95eb-46ea-9d19-cd80b44a3283", + "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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "visibility": { + "name": "visibility", + "type": "board_visibility", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'private'" + }, + "type": { + "name": "type", + "type": "board_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'regular'" + }, + "isArchived": { + "name": "isArchived", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sourceBoardId": { + "name": "sourceBoardId", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "board_is_archived_idx": { + "name": "board_is_archived_idx", + "columns": [ + { + "expression": "isArchived", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "board_visibility_idx": { + "name": "board_visibility_idx", + "columns": [ + { + "expression": "visibility", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "board_type_idx": { + "name": "board_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "board_source_idx": { + "name": "board_source_idx", + "columns": [ + { + "expression": "sourceBoardId", + "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": "set null", + "onUpdate": "no action" + }, + "board_deletedBy_user_id_fk": { + "name": "board_deletedBy_user_id_fk", + "tableFrom": "board", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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.user_board_favorites": { + "name": "user_board_favorites", + "schema": "", + "columns": { + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "boardId": { + "name": "boardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "user_board_favorite_user_idx": { + "name": "user_board_favorite_user_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_board_favorite_board_idx": { + "name": "user_board_favorite_board_idx", + "columns": [ + { + "expression": "boardId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_board_favorites_userId_user_id_fk": { + "name": "user_board_favorites_userId_user_id_fk", + "tableFrom": "user_board_favorites", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_board_favorites_boardId_board_id_fk": { + "name": "user_board_favorites_boardId_board_id_fk", + "tableFrom": "user_board_favorites", + "tableTo": "board", + "columnsFrom": [ + "boardId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "user_board_favorites_userId_boardId_pk": { + "name": "user_board_favorites_userId_boardId_pk", + "columns": [ + "userId", + "boardId" + ] + } + }, + "uniqueConstraints": {}, + "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": "text", + "primaryKey": false, + "notNull": false + }, + "toTitle": { + "name": "toTitle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fromDescription": { + "name": "fromDescription", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "toDescription": { + "name": "toDescription", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "commentId": { + "name": "commentId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "fromComment": { + "name": "fromComment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "toComment": { + "name": "toComment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "fromDueDate": { + "name": "fromDueDate", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "toDueDate": { + "name": "toDueDate", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "sourceBoardId": { + "name": "sourceBoardId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "attachmentId": { + "name": "attachmentId", + "type": "bigint", + "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": "cascade", + "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": "cascade", + "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": "cascade", + "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": "set null", + "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": "set null", + "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": "cascade", + "onUpdate": "no action" + }, + "card_activity_sourceBoardId_board_id_fk": { + "name": "card_activity_sourceBoardId_board_id_fk", + "tableFrom": "card_activity", + "tableTo": "board", + "columnsFrom": [ + "sourceBoardId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "card_activity_attachmentId_card_attachment_id_fk": { + "name": "card_activity_attachmentId_card_attachment_id_fk", + "tableFrom": "card_activity", + "tableTo": "card_attachment", + "columnsFrom": [ + "attachmentId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_activity_publicId_unique": { + "name": "card_activity_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card_attachment": { + "name": "card_attachment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "filename": { + "name": "filename", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "originalFilename": { + "name": "originalFilename", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "contentType": { + "name": "contentType", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "size": { + "name": "size", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "s3Key": { + "name": "s3Key", + "type": "varchar(500)", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_attachment_cardId_card_id_fk": { + "name": "card_attachment_cardId_card_id_fk", + "tableFrom": "card_attachment", + "tableTo": "card", + "columnsFrom": [ + "cardId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "card_attachment_createdBy_user_id_fk": { + "name": "card_attachment_createdBy_user_id_fk", + "tableFrom": "card_attachment", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_attachment_publicId_unique": { + "name": "card_attachment_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": "cascade", + "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": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "index": { + "name": "index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "listId": { + "name": "listId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "dueDate": { + "name": "dueDate", + "type": "timestamp", + "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": "set null", + "onUpdate": "no action" + }, + "card_deletedBy_user_id_fk": { + "name": "card_deletedBy_user_id_fk", + "tableFrom": "card", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": "cascade", + "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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_comments_cardId_card_id_fk": { + "name": "card_comments_cardId_card_id_fk", + "tableFrom": "card_comments", + "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": "set null", + "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": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_comments_publicId_unique": { + "name": "card_comments_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card_checklist_item": { + "name": "card_checklist_item", + "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(500)", + "primaryKey": false, + "notNull": true + }, + "completed": { + "name": "completed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "index": { + "name": "index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "checklistId": { + "name": "checklistId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_checklist_item_checklistId_card_checklist_id_fk": { + "name": "card_checklist_item_checklistId_card_checklist_id_fk", + "tableFrom": "card_checklist_item", + "tableTo": "card_checklist", + "columnsFrom": [ + "checklistId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "card_checklist_item_createdBy_user_id_fk": { + "name": "card_checklist_item_createdBy_user_id_fk", + "tableFrom": "card_checklist_item", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "card_checklist_item_deletedBy_user_id_fk": { + "name": "card_checklist_item_deletedBy_user_id_fk", + "tableFrom": "card_checklist_item", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_checklist_item_publicId_unique": { + "name": "card_checklist_item_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.card_checklist": { + "name": "card_checklist", + "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 + }, + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "card_checklist_cardId_card_id_fk": { + "name": "card_checklist_cardId_card_id_fk", + "tableFrom": "card_checklist", + "tableTo": "card", + "columnsFrom": [ + "cardId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "card_checklist_createdBy_user_id_fk": { + "name": "card_checklist_createdBy_user_id_fk", + "tableFrom": "card_checklist", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "card_checklist_deletedBy_user_id_fk": { + "name": "card_checklist_deletedBy_user_id_fk", + "tableFrom": "card_checklist", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "card_checklist_publicId_unique": { + "name": "card_checklist_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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reviewed": { + "name": "reviewed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "feedback_createdBy_user_id_fk": { + "name": "feedback_createdBy_user_id_fk", + "tableFrom": "feedback", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "import_createdBy_user_id_fk": { + "name": "import_createdBy_user_id_fk", + "tableFrom": "import", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "boardId": { + "name": "boardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "label_createdBy_user_id_fk": { + "name": "label_createdBy_user_id_fk", + "tableFrom": "label", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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" + }, + "label_deletedBy_user_id_fk": { + "name": "label_deletedBy_user_id_fk", + "tableFrom": "label", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "boardId": { + "name": "boardId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "importId": { + "name": "importId", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "list_createdBy_user_id_fk": { + "name": "list_createdBy_user_id_fk", + "tableFrom": "list", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "list_deletedBy_user_id_fk": { + "name": "list_deletedBy_user_id_fk", + "tableFrom": "list", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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.integration": { + "name": "integration", + "schema": "", + "columns": { + "provider": { + "name": "provider", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "accessToken": { + "name": "accessToken", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refreshToken": { + "name": "refreshToken", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "expiresAt": { + "name": "expiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "integration_userId_user_id_fk": { + "name": "integration_userId_user_id_fk", + "tableFrom": "integration", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "integration_pkey": { + "name": "integration_pkey", + "columns": [ + "userId", + "provider" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_slug_checks": { + "name": "workspace_slug_checks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "available": { + "name": "available", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "reserved": { + "name": "reserved", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_slug_checks_workspaceId_workspace_id_fk": { + "name": "workspace_slug_checks_workspaceId_workspace_id_fk", + "tableFrom": "workspace_slug_checks", + "tableTo": "workspace", + "columnsFrom": [ + "workspaceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "workspace_slug_checks_createdBy_user_id_fk": { + "name": "workspace_slug_checks_createdBy_user_id_fk", + "tableFrom": "workspace_slug_checks", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "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 + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "roleId": { + "name": "roleId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "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": "set null", + "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": "set null", + "onUpdate": "no action" + }, + "workspace_members_roleId_workspace_roles_id_fk": { + "name": "workspace_members_roleId_workspace_roles_id_fk", + "tableFrom": "workspace_members", + "tableTo": "workspace_roles", + "columnsFrom": [ + "roleId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "restrict", + "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'" + }, + "showEmailsToMembers": { + "name": "showEmailsToMembers", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "weekStartDay": { + "name": "weekStartDay", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deletedBy": { + "name": "deletedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_createdBy_user_id_fk": { + "name": "workspace_createdBy_user_id_fk", + "tableFrom": "workspace", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_deletedBy_user_id_fk": { + "name": "workspace_deletedBy_user_id_fk", + "tableFrom": "workspace", + "tableTo": "user", + "columnsFrom": [ + "deletedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "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 + }, + "public.subscription": { + "name": "subscription", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan": { + "name": "plan", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "referenceId": { + "name": "referenceId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": false + }, + "stripeCustomerId": { + "name": "stripeCustomerId", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "stripeSubscriptionId": { + "name": "stripeSubscriptionId", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "periodStart": { + "name": "periodStart", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "periodEnd": { + "name": "periodEnd", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "cancelAtPeriodEnd": { + "name": "cancelAtPeriodEnd", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "seats": { + "name": "seats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "unlimitedSeats": { + "name": "unlimitedSeats", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "trialStart": { + "name": "trialStart", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "trialEnd": { + "name": "trialEnd", + "type": "timestamp", + "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()" + } + }, + "indexes": {}, + "foreignKeys": { + "subscription_referenceId_workspace_publicId_fk": { + "name": "subscription_referenceId_workspace_publicId_fk", + "tableFrom": "subscription", + "tableTo": "workspace", + "columnsFrom": [ + "referenceId" + ], + "columnsTo": [ + "publicId" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_invite_links": { + "name": "workspace_invite_links", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "invite_link_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "expiresAt": { + "name": "expiresAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "createdBy": { + "name": "createdBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updatedBy": { + "name": "updatedBy", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_invite_links_workspaceId_workspace_id_fk": { + "name": "workspace_invite_links_workspaceId_workspace_id_fk", + "tableFrom": "workspace_invite_links", + "tableTo": "workspace", + "columnsFrom": [ + "workspaceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_invite_links_createdBy_user_id_fk": { + "name": "workspace_invite_links_createdBy_user_id_fk", + "tableFrom": "workspace_invite_links", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_invite_links_updatedBy_user_id_fk": { + "name": "workspace_invite_links_updatedBy_user_id_fk", + "tableFrom": "workspace_invite_links", + "tableTo": "user", + "columnsFrom": [ + "updatedBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_invite_links_publicId_unique": { + "name": "workspace_invite_links_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + }, + "workspace_invite_links_code_unique": { + "name": "workspace_invite_links_code_unique", + "nullsNotDistinct": false, + "columns": [ + "code" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_member_permissions": { + "name": "workspace_member_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "workspaceMemberId": { + "name": "workspaceMemberId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "granted": { + "name": "granted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_member_permission": { + "name": "unique_member_permission", + "columns": [ + { + "expression": "workspaceMemberId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "permission", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_member_idx": { + "name": "permission_member_idx", + "columns": [ + { + "expression": "workspaceMemberId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_role_permissions": { + "name": "workspace_role_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "workspaceRoleId": { + "name": "workspaceRoleId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "granted": { + "name": "granted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "unique_role_permission": { + "name": "unique_role_permission", + "columns": [ + { + "expression": "workspaceRoleId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "permission", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "role_permissions_role_idx": { + "name": "role_permissions_role_idx", + "columns": [ + { + "expression": "workspaceRoleId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_role_permissions_workspaceRoleId_workspace_roles_id_fk": { + "name": "workspace_role_permissions_workspaceRoleId_workspace_roles_id_fk", + "tableFrom": "workspace_role_permissions", + "tableTo": "workspace_roles", + "columnsFrom": [ + "workspaceRoleId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_roles": { + "name": "workspace_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "hierarchyLevel": { + "name": "hierarchyLevel", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "isSystem": { + "name": "isSystem", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updatedAt": { + "name": "updatedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "unique_role_per_workspace": { + "name": "unique_role_per_workspace", + "columns": [ + { + "expression": "workspaceId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_roles_workspace_idx": { + "name": "workspace_roles_workspace_idx", + "columns": [ + { + "expression": "workspaceId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_roles_workspaceId_workspace_id_fk": { + "name": "workspace_roles_workspaceId_workspace_id_fk", + "tableFrom": "workspace_roles", + "tableTo": "workspace", + "columnsFrom": [ + "workspaceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_roles_publicId_unique": { + "name": "workspace_roles_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.notification": { + "name": "notification", + "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": "notification_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "userId": { + "name": "userId", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "cardId": { + "name": "cardId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "commentId": { + "name": "commentId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "readAt": { + "name": "readAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deletedAt": { + "name": "deletedAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "notification_user_deleted_idx": { + "name": "notification_user_deleted_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deletedAt", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "notification_user_read_deleted_idx": { + "name": "notification_user_read_deleted_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "readAt", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deletedAt", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "notification_user_type_card_idx": { + "name": "notification_user_type_card_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cardId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "notification_user_type_workspace_idx": { + "name": "notification_user_type_workspace_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspaceId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "notification_user_created_idx": { + "name": "notification_user_created_idx", + "columns": [ + { + "expression": "userId", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "createdAt", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "notification_userId_user_id_fk": { + "name": "notification_userId_user_id_fk", + "tableFrom": "notification", + "tableTo": "user", + "columnsFrom": [ + "userId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_cardId_card_id_fk": { + "name": "notification_cardId_card_id_fk", + "tableFrom": "notification", + "tableTo": "card", + "columnsFrom": [ + "cardId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_commentId_card_comments_id_fk": { + "name": "notification_commentId_card_comments_id_fk", + "tableFrom": "notification", + "tableTo": "card_comments", + "columnsFrom": [ + "commentId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_workspaceId_workspace_id_fk": { + "name": "notification_workspaceId_workspace_id_fk", + "tableFrom": "notification", + "tableTo": "workspace", + "columnsFrom": [ + "workspaceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "notification_publicId_unique": { + "name": "notification_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + }, + "public.workspace_webhooks": { + "name": "workspace_webhooks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "publicId": { + "name": "publicId", + "type": "varchar(12)", + "primaryKey": false, + "notNull": true + }, + "workspaceId": { + "name": "workspaceId", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "varchar(2048)", + "primaryKey": false, + "notNull": true + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "events": { + "name": "events", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": 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 + } + }, + "indexes": { + "workspace_webhooks_workspace_idx": { + "name": "workspace_webhooks_workspace_idx", + "columns": [ + { + "expression": "workspaceId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_webhooks_workspaceId_workspace_id_fk": { + "name": "workspace_webhooks_workspaceId_workspace_id_fk", + "tableFrom": "workspace_webhooks", + "tableTo": "workspace", + "columnsFrom": [ + "workspaceId" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_webhooks_createdBy_user_id_fk": { + "name": "workspace_webhooks_createdBy_user_id_fk", + "tableFrom": "workspace_webhooks", + "tableTo": "user", + "columnsFrom": [ + "createdBy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_webhooks_publicId_unique": { + "name": "workspace_webhooks_publicId_unique", + "nullsNotDistinct": false, + "columns": [ + "publicId" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": true + } + }, + "enums": { + "public.board_type": { + "name": "board_type", + "schema": "public", + "values": [ + "regular", + "template" + ] + }, + "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.updated.checklist.added", + "card.updated.checklist.renamed", + "card.updated.checklist.deleted", + "card.updated.checklist.item.added", + "card.updated.checklist.item.updated", + "card.updated.checklist.item.completed", + "card.updated.checklist.item.uncompleted", + "card.updated.checklist.item.deleted", + "card.updated.attachment.added", + "card.updated.attachment.removed", + "card.updated.dueDate.added", + "card.updated.dueDate.updated", + "card.updated.dueDate.removed", + "card.archived" + ] + }, + "public.source": { + "name": "source", + "schema": "public", + "values": [ + "trello", + "github" + ] + }, + "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", + "paused" + ] + }, + "public.slug_type": { + "name": "slug_type", + "schema": "public", + "values": [ + "reserved", + "premium" + ] + }, + "public.workspace_plan": { + "name": "workspace_plan", + "schema": "public", + "values": [ + "free", + "pro", + "enterprise" + ] + }, + "public.invite_link_status": { + "name": "invite_link_status", + "schema": "public", + "values": [ + "active", + "inactive" + ] + }, + "public.notification_type": { + "name": "notification_type", + "schema": "public", + "values": [ + "mention", + "workspace.member.added", + "workspace.member.removed", + "workspace.role.changed" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 4ea47842..7f6f71f7 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -206,11 +206,18 @@ "breakpoints": true }, { - "idx": 28, + "idx": 29, "version": "7", "when": 1771930355536, "tag": "20260224105235_AddGitHubIntegrationSupport", "breakpoints": true + }, + { + "idx": 30, + "version": "7", + "when": 1773212242728, + "tag": "20260311065722_AddWeekStartDay", + "breakpoints": true } ] -} +} \ No newline at end of file diff --git a/packages/db/src/repository/workspace.repo.ts b/packages/db/src/repository/workspace.repo.ts index 964367a9..8ea13d70 100644 --- a/packages/db/src/repository/workspace.repo.ts +++ b/packages/db/src/repository/workspace.repo.ts @@ -127,6 +127,7 @@ export const update = async ( plan?: "free" | "pro" | "enterprise"; description?: string; showEmailsToMembers?: boolean; + weekStartDay?: number; }, ) => { const [result] = await db @@ -137,6 +138,7 @@ export const update = async ( plan: workspaceInput.plan, description: workspaceInput.description, showEmailsToMembers: workspaceInput.showEmailsToMembers, + weekStartDay: workspaceInput.weekStartDay, }) .where(eq(workspaces.publicId, workspacePublicId)) .returning({ @@ -147,6 +149,7 @@ export const update = async ( description: workspaces.description, plan: workspaces.plan, showEmailsToMembers: workspaces.showEmailsToMembers, + weekStartDay: workspaces.weekStartDay, }); return result; @@ -189,6 +192,7 @@ export const getByPublicIdWithMembers = ( name: true, slug: true, showEmailsToMembers: true, + weekStartDay: true, }, with: { members: { @@ -274,6 +278,7 @@ export const getAllByUserId = async (db: dbClient, userId: string) => { description: true, slug: true, plan: true, + weekStartDay: true, deletedAt: true, }, // https://github.com/drizzle-team/drizzle-orm/issues/2903 diff --git a/packages/db/src/schema/workspaces.ts b/packages/db/src/schema/workspaces.ts index 415d3e71..31d390e4 100644 --- a/packages/db/src/schema/workspaces.ts +++ b/packages/db/src/schema/workspaces.ts @@ -3,6 +3,7 @@ import { bigint, bigserial, boolean, + integer, pgEnum, pgTable, text, @@ -45,6 +46,7 @@ export const workspaces = pgTable("workspace", { slug: varchar("slug", { length: 255 }).notNull().unique(), plan: workspacePlanEnum("plan").notNull().default("free"), showEmailsToMembers: boolean("showEmailsToMembers").notNull().default(true), + weekStartDay: integer("weekStartDay").notNull().default(1), createdBy: uuid("createdBy").references(() => users.id, { onDelete: "set null", }),