diff --git a/apps/builder/__tests__/capi-connection-state.test.ts b/apps/builder/__tests__/capi-connection-state.test.ts index 2400ed751f..d9a09602e9 100644 --- a/apps/builder/__tests__/capi-connection-state.test.ts +++ b/apps/builder/__tests__/capi-connection-state.test.ts @@ -78,4 +78,37 @@ describe("getCapiConnectionState", () => { }), ).toBe("disconnected") }) + + test("dataset saved but scope missing and no manual token awaits scope", () => { + expect( + getCapiConnectionState({ + capiDisconnected: false, + hasManualCapiAccessToken: false, + hasCapiScope: false, + hasDatasetId: true, + }), + ).toBe("awaitingScope") + }) + + test("user disconnect overrides an awaiting-scope dataset", () => { + expect( + getCapiConnectionState({ + capiDisconnected: true, + hasManualCapiAccessToken: false, + hasCapiScope: false, + hasDatasetId: true, + }), + ).toBe("disconnected") + }) + + test("manual token with dataset stays connectedCustom even without scope", () => { + expect( + getCapiConnectionState({ + capiDisconnected: false, + hasManualCapiAccessToken: true, + hasCapiScope: false, + hasDatasetId: true, + }), + ).toBe("connectedCustom") + }) }) diff --git a/apps/builder/__tests__/capi-status.test.ts b/apps/builder/__tests__/capi-status.test.ts new file mode 100644 index 0000000000..0cb6851bbe --- /dev/null +++ b/apps/builder/__tests__/capi-status.test.ts @@ -0,0 +1,107 @@ +import { describe, expect, test } from "vitest" +import { getCapiStatus } from "@/features/meta-conversions/lib/capi-status" + +describe("getCapiStatus", () => { + test("unsupported wins over every other input", () => { + expect( + getCapiStatus({ + hasCapiScope: true, + hasManualCapiAccessToken: true, + hasDatasetId: true, + credentialAvailable: true, + supported: false, + }), + ).toBe("unsupported") + }) + + test("manual token with dataset is ready", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: true, + hasDatasetId: true, + credentialAvailable: true, + }), + ).toBe("ready") + }) + + test("oauth scope with dataset is ready", () => { + expect( + getCapiStatus({ + hasCapiScope: true, + hasManualCapiAccessToken: false, + hasDatasetId: true, + credentialAvailable: true, + }), + ).toBe("ready") + }) + + test("credential unavailable is unverified even with a dataset saved", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: false, + hasDatasetId: true, + credentialAvailable: false, + }), + ).toBe("unverified") + }) + + test("dataset saved, scope missing, no manual token, credential available is missingPermission", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: false, + hasDatasetId: true, + credentialAvailable: true, + }), + ).toBe("missingPermission") + }) + + test("nothing configured with credential available is notConnected", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: false, + hasDatasetId: false, + credentialAvailable: true, + }), + ).toBe("notConnected") + }) + + test("user disconnect wins even with a dataset and scope", () => { + expect( + getCapiStatus({ + hasCapiScope: true, + hasManualCapiAccessToken: false, + hasDatasetId: true, + credentialAvailable: true, + capiDisconnected: true, + }), + ).toBe("notConnected") + }) + + test("user disconnect wins even with a manual token and dataset", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: true, + hasDatasetId: true, + credentialAvailable: true, + capiDisconnected: true, + }), + ).toBe("notConnected") + }) + + test("user disconnect with a saved dataset is notConnected, not missingPermission", () => { + expect( + getCapiStatus({ + hasCapiScope: false, + hasManualCapiAccessToken: false, + hasDatasetId: true, + credentialAvailable: true, + capiDisconnected: true, + }), + ).toBe("notConnected") + }) +}) diff --git a/apps/builder/__tests__/capi-test-event-actions.test.ts b/apps/builder/__tests__/capi-test-event-actions.test.ts new file mode 100644 index 0000000000..503076c968 --- /dev/null +++ b/apps/builder/__tests__/capi-test-event-actions.test.ts @@ -0,0 +1,157 @@ +// @vitest-environment node + +import { beforeEach, describe, expect, test, vi } from "vitest" +import { saveCapiTestEventCodeAction } from "../src/features/meta-conversions/actions/save-capi-test-event-code.action" +import { sendCapiTestEventAction } from "../src/features/meta-conversions/actions/send-capi-test-event.action" + +type SaveHandler = (args: { + parsedInput: { + channel: "messenger" | "instagram" | "whatsapp" + testEventCode: string | null + } + bindArgsParsedInputs: readonly [string, string] +}) => Promise + +type SendHandler = (args: { + parsedInput: { channel: "messenger" | "instagram" | "whatsapp" } + bindArgsParsedInputs: readonly [string, string] +}) => Promise + +const mocks = vi.hoisted(() => ({ + assertWorkspaceSuperAdmin: vi.fn(), + messengerFindByIdForWorkspace: vi.fn(), + instagramFindByIdForWorkspace: vi.fn(), + whatsappFindByIdForWorkspace: vi.fn(), + saveCapiTestEventCode: vi.fn(), + enqueueTestEvent: vi.fn(), +})) + +vi.mock("@/lib/safe-action", () => { + const chain: Record = {} + chain.bindArgsSchemas = () => chain + chain.inputSchema = () => chain + chain.action = (handler: SaveHandler | SendHandler) => handler + return { workspaceActionClient: chain } +}) + +vi.mock("@/lib/auth/assert-workspace-super-admin", () => ({ + assertWorkspaceSuperAdmin: mocks.assertWorkspaceSuperAdmin, +})) + +vi.mock("@chatbotx.io/business", () => { + class CapiTestEventError extends Error { + readonly reason: string + + constructor(reason: string) { + super(reason) + this.name = "CapiTestEventError" + this.reason = reason + } + } + return { + CapiTestEventError, + messengerIntegrationService: { + findByIdForWorkspace: mocks.messengerFindByIdForWorkspace, + }, + instagramIntegrationService: { + findByIdForWorkspace: mocks.instagramFindByIdForWorkspace, + }, + integrationWhatsappService: { + findByIdForWorkspace: mocks.whatsappFindByIdForWorkspace, + }, + metaConversionsService: { + saveCapiTestEventCode: mocks.saveCapiTestEventCode, + enqueueTestEvent: mocks.enqueueTestEvent, + }, + } +}) + +vi.mock("next-intl/server", () => ({ + getTranslations: async () => (key: string) => `t:${key}`, +})) + +const save = saveCapiTestEventCodeAction as unknown as SaveHandler +const send = sendCapiTestEventAction as unknown as SendHandler +const bound = ["ws-1", "im-1"] as const +const integration = { id: "im-1", workspaceId: "ws-1" } + +describe("CAPI test event actions", () => { + beforeEach(() => { + vi.clearAllMocks() + mocks.messengerFindByIdForWorkspace.mockResolvedValue(integration) + mocks.whatsappFindByIdForWorkspace.mockResolvedValue(integration) + }) + + test("save routes to the channel's integration lookup and stores the code", async () => { + await expect( + save({ + parsedInput: { channel: "messenger", testEventCode: "TEST33520" }, + bindArgsParsedInputs: bound, + }), + ).resolves.toEqual({ success: true, testEventCode: "TEST33520" }) + + expect(mocks.assertWorkspaceSuperAdmin).toHaveBeenCalledWith("ws-1") + expect(mocks.messengerFindByIdForWorkspace).toHaveBeenCalledWith({ + id: "im-1", + workspaceId: "ws-1", + }) + expect(mocks.saveCapiTestEventCode).toHaveBeenCalledWith({ + channel: "messenger", + integration, + testEventCode: "TEST33520", + }) + }) + + test("save with null clears the code for a WhatsApp integration", async () => { + await save({ + parsedInput: { channel: "whatsapp", testEventCode: null }, + bindArgsParsedInputs: bound, + }) + + expect(mocks.whatsappFindByIdForWorkspace).toHaveBeenCalled() + expect(mocks.saveCapiTestEventCode).toHaveBeenCalledWith( + expect.objectContaining({ channel: "whatsapp", testEventCode: null }), + ) + }) + + test("save surfaces a translated not-found error per channel", async () => { + mocks.instagramFindByIdForWorkspace.mockResolvedValue(null) + + await expect( + save({ + parsedInput: { channel: "instagram", testEventCode: "TEST1" }, + bindArgsParsedInputs: bound, + }), + ).rejects.toThrow("t:instagramNotFound") + expect(mocks.saveCapiTestEventCode).not.toHaveBeenCalled() + }) + + test("send queues a test event and reports whether a row was created", async () => { + mocks.enqueueTestEvent.mockResolvedValue({ id: "mce-1" }) + + await expect( + send({ + parsedInput: { channel: "messenger" }, + bindArgsParsedInputs: bound, + }), + ).resolves.toEqual({ success: true, queued: true }) + expect(mocks.enqueueTestEvent).toHaveBeenCalledWith({ + channel: "messenger", + integration, + }) + }) + + test("send translates a CapiTestEventError reason for the toast", async () => { + const { CapiTestEventError } = await import("@chatbotx.io/business") + mocks.enqueueTestEvent.mockRejectedValue( + new CapiTestEventError("noContactForTest"), + ) + + await expect( + send({ + parsedInput: { channel: "messenger" }, + bindArgsParsedInputs: bound, + }), + ).rejects.toThrow("t:noContactForTest") + }) +}) diff --git a/apps/builder/__tests__/contact-inbox-panel.test.tsx b/apps/builder/__tests__/contact-inbox-panel.test.tsx index 1993616d0b..712760df60 100644 --- a/apps/builder/__tests__/contact-inbox-panel.test.tsx +++ b/apps/builder/__tests__/contact-inbox-panel.test.tsx @@ -12,8 +12,6 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest" // requests can settle out of order (the initial one is often slower — it // races the Graph/Telegram round trip the refresh triggers) — whichever // request was issued LAST must win, never whichever RESOLVES last. -// See docs/plans/2026-08-31-messenger-ctm-profile-backfill.md, fix wave 2 -// finding 3. // --------------------------------------------------------------------------- vi.mock("next-intl", () => ({ diff --git a/apps/builder/__tests__/event-label.test.ts b/apps/builder/__tests__/event-label.test.ts new file mode 100644 index 0000000000..0d35240753 --- /dev/null +++ b/apps/builder/__tests__/event-label.test.ts @@ -0,0 +1,55 @@ +// @vitest-environment node +import { createTranslator } from "next-intl" +import { describe, expect, test } from "vitest" +import messages from "../messages/en.json" +import { + getMetaCapiActionSourceLabel, + getMetaCapiContentTypeLabel, + getMetaCapiEventLabel, + META_CAPI_ACTION_SOURCE_DOCS_URL, +} from "../src/features/meta-conversions/lib/event-label" + +const t = createTranslator({ locale: "en", messages }) + +describe("getMetaCapiEventLabel", () => { + test("returns the translated label for a business-messaging standard event", () => { + expect(getMetaCapiEventLabel("LeadSubmitted", t)).toBe("Lead Submitted") + expect(getMetaCapiEventLabel("Purchase", t)).toBe("Purchase") + expect(getMetaCapiEventLabel("CartAbandoned", t)).toBe("Cart Abandoned") + }) + + test("returns the translated label for a pixel-only standard event", () => { + expect(getMetaCapiEventLabel("Lead", t)).toBe("Lead") + expect(getMetaCapiEventLabel("AddPaymentInfo", t)).toBe("Add Payment Info") + expect(getMetaCapiEventLabel("Subscribe", t)).toBe("Subscribe") + }) + + test("returns the raw custom name verbatim for an unknown event name", () => { + expect(getMetaCapiEventLabel("MyCustomEvent", t)).toBe("MyCustomEvent") + }) +}) + +describe("getMetaCapiActionSourceLabel", () => { + test("returns the translated label for every action source", () => { + expect(getMetaCapiActionSourceLabel("business_messaging", t)).toBe( + "Business Messaging", + ) + expect(getMetaCapiActionSourceLabel("email", t)).toBe("Email") + expect(getMetaCapiActionSourceLabel("other", t)).toBe("Other") + }) +}) + +describe("getMetaCapiContentTypeLabel", () => { + test("returns the translated label for every content type", () => { + expect(getMetaCapiContentTypeLabel("product", t)).toBe("Product") + expect(getMetaCapiContentTypeLabel("product_group", t)).toBe( + "Product Group", + ) + }) +}) + +test("META_CAPI_ACTION_SOURCE_DOCS_URL points at Meta's action_source docs", () => { + expect(META_CAPI_ACTION_SOURCE_DOCS_URL).toBe( + "https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event#action_source", + ) +}) diff --git a/apps/builder/__tests__/meta-capi-event-dialog.test.tsx b/apps/builder/__tests__/meta-capi-event-dialog.test.tsx new file mode 100644 index 0000000000..32849a791e --- /dev/null +++ b/apps/builder/__tests__/meta-capi-event-dialog.test.tsx @@ -0,0 +1,668 @@ +// @vitest-environment jsdom +import type { MetaCapiEventFieldsSchema } from "@chatbotx.io/flow-config" +import { + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@chatbotx.io/ui/components/ui/form" +import type { ReactElement, ReactNode } from "react" +import { act, createContext, useContext, useState } from "react" +import { createRoot, type Root } from "react-dom/client" +import { + Controller, + FormProvider, + type UseFormReturn, + useForm, + useFormContext, +} from "react-hook-form" +import { afterEach, beforeEach, describe, expect, test, vi } from "vitest" +import { MetaCapiEventDialog } from "@/features/meta-conversions/components/meta-capi-event-dialog" + +/** Echoes the key back so assertions never depend on translated copy. */ +vi.mock("next-intl", () => ({ + useTranslations: () => (key: string) => key, +})) + +// --------------------------------------------------------------------------- +// Dialog primitives: a minimal controlled stand-in that keeps its content +// mounted (via `hidden`, never unmounted) while closed — mirroring Base UI's +// real behavior of keeping the portal mounted through the close transition +// (see dialog.tsx comments) — so the remount-on-reopen fix is actually +// exercised by the "rapid close→reopen" test rather than papered over by a +// mock that unmounts on close by itself. +// --------------------------------------------------------------------------- +type DialogCtxValue = { open: boolean; setOpen: (next: boolean) => void } +const DialogCtx = createContext({ + open: false, + setOpen: () => undefined, +}) + +vi.mock("@chatbotx.io/ui/components/ui/dialog", async () => { + const react = await import("react") + const Pass = ({ children }: { children?: ReactNode }) => <>{children} + return { + Dialog: ({ + children, + open, + onOpenChange, + }: { + children: ReactNode + open: boolean + onOpenChange: (next: boolean) => void + }) => ( + + {children} + + ), + DialogTrigger: ({ + render, + }: { + render: ReactElement<{ onClick?: () => void }> + }) => { + const { setOpen } = react.useContext(DialogCtx) + return react.cloneElement(render, { onClick: () => setOpen(true) }) + }, + DialogClose: ({ + render, + }: { + render: ReactElement<{ onClick?: () => void }> + }) => { + const { setOpen } = react.useContext(DialogCtx) + return react.cloneElement(render, { onClick: () => setOpen(false) }) + }, + DialogContent: ({ children }: { children: ReactNode }) => { + const { open } = react.useContext(DialogCtx) + return ( + + ) + }, + DialogHeader: Pass, + DialogTitle: Pass, + DialogDescription: Pass, + DialogFooter: Pass, + } +}) + +// Base UI's Tooltip only mounts its popup once actually opened; not relevant +// to this test's assertions. +vi.mock("@chatbotx.io/ui/components/ui/tooltip", () => ({ + Tooltip: ({ children }: { children: ReactNode }) => <>{children}, + TooltipTrigger: ({ render }: { render: ReactNode }) => render, + TooltipContent: ({ children }: { children: ReactNode }) => ( +
{children}
+ ), +})) + +// Collapsible: a minimal controlled stand-in, default closed. +vi.mock("@chatbotx.io/ui/components/ui/collapsible", () => { + const CollapsibleCtx = createContext<{ + open: boolean + setOpen: (next: boolean) => void + }>({ open: false, setOpen: () => undefined }) + return { + Collapsible: ({ children }: { children: ReactNode }) => { + const [open, setOpen] = useState(false) + return ( + + {children} + + ) + }, + CollapsibleTrigger: ({ + children, + className, + }: { + children: ReactNode + className?: string + }) => { + const { open, setOpen } = useContext(CollapsibleCtx) + return ( + + ) + }, + CollapsibleContent: ({ children }: { children: ReactNode }) => { + const { open } = useContext(CollapsibleCtx) + return open ?
{children}
: null + }, + } +}) + +// PlainTextEditorField: real components need Tiptap/ProseMirror, which is +// not jsdom-friendly. This stand-in mirrors the one behavior under test — +// it snapshots `getValues(name)` once via a lazy initial state (mirroring +// the real component's mount-only effect at plain-text-editor-field.tsx:51) +// into an *uncontrolled* input, so a value written to the form after mount +// (e.g. by `form.reset`) is invisible unless the component remounts. +vi.mock("@/components/tiptap/plain-text-editor-field", () => ({ + PlainTextEditorField: ({ name, label }: { name: string; label?: string }) => { + const { control, getValues } = useFormContext() + const [initValue] = useState(() => getValues(name) ?? "") + return ( + ( + + {label ? {label} : null} + + field.onChange(event.target.value)} + /> + + + + )} + /> + ) + }, +})) + +type SelectLikeOption = { value: string; label: string } +type GroupedOption = SelectLikeOption & { children?: SelectLikeOption[] } + +const flattenOptions = (options: GroupedOption[]): SelectLikeOption[] => + options.flatMap((option) => option.children ?? [option]) + +// SelectField: flat native ` { + field.onChange(event.target.value) + triggerValueChange?.(event.target.value) + }} + value={field.value ?? ""} + > + + {options.map((option) => ( + + ))} + + + )} + /> + ) + }, +})) + +// ComboboxField: flat native ` { + field.onChange(event.target.value) + triggerValueChange?.(event.target.value) + }} + value={field.value ?? ""} + > + {flat.map((option) => ( + + ))} + + + )} + /> + ) + }, +})) + +let container: HTMLDivElement +let root: Root +let formApi: UseFormReturn<{ step: MetaCapiEventFieldsSchema }> | null = null + +beforeEach(() => { + ;( + globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean } + ).IS_REACT_ACT_ENVIRONMENT = true + formApi = null + container = document.createElement("div") + document.body.appendChild(container) + root = createRoot(container) +}) + +afterEach(() => { + act(() => { + root.unmount() + }) + container.remove() +}) + +const defaultFields: MetaCapiEventFieldsSchema = { + eventName: "LeadSubmitted", + actionSource: "business_messaging", + contentType: undefined, + contentIds: undefined, + value: undefined, + currency: undefined, + contentCategory: undefined, + contentName: undefined, +} + +function Harness({ + initial = defaultFields, +}: { + initial?: MetaCapiEventFieldsSchema +}) { + const form = useForm<{ step: MetaCapiEventFieldsSchema }>({ + defaultValues: { step: initial }, + }) + formApi = form + + return ( + + + + ) +} + +const render = (initial?: MetaCapiEventFieldsSchema) => { + act(() => { + root.render() + }) +} + +const flush = async () => { + await act(async () => { + await Promise.resolve() + await Promise.resolve() + }) +} + +function findByText(selector: string, text: string): HTMLElement { + const found = Array.from(container.querySelectorAll(selector)).find( + (element) => element.textContent?.includes(text), + ) + if (!found) { + throw new Error(`No "${selector}" with text "${text}" found`) + } + return found as HTMLElement +} + +function openDialog() { + const trigger = findByText("button", "actions.edit") + act(() => { + trigger.click() + }) +} + +function clickConfirm() { + const confirm = findByText("form button", "actions.confirm") + act(() => { + confirm.click() + }) +} + +function clickCancel() { + const cancel = findByText("form button", "actions.cancel") + act(() => { + cancel.click() + }) +} + +function setInputValue(input: HTMLInputElement, value: string) { + const setter = Object.getOwnPropertyDescriptor( + HTMLInputElement.prototype, + "value", + )?.set + act(() => { + setter?.call(input, value) + input.dispatchEvent(new Event("input", { bubbles: true })) + }) +} + +function selectOption(select: HTMLSelectElement, value: string) { + act(() => { + select.value = value + select.dispatchEvent(new Event("change", { bubbles: true })) + }) +} + +function input(name: string): HTMLInputElement { + const found = container.querySelector(`[data-testid="input-${name}"]`) + if (!found) { + throw new Error(`input-${name} not found`) + } + return found as HTMLInputElement +} + +function select(name: string, kind: "select" | "combobox" = "select") { + const found = container.querySelector(`[data-testid="${kind}-${name}"]`) + if (!found) { + throw new Error(`${kind}-${name} not found`) + } + return found as HTMLSelectElement +} + +describe("MetaCapiEventDialog", () => { + test("opens the dialog when the trigger card is clicked", async () => { + render() + await flush() + + expect( + (container.querySelector('[data-testid="dialog-content"]') as HTMLElement) + .hidden, + ).toBe(true) + + openDialog() + await flush() + + expect( + (container.querySelector('[data-testid="dialog-content"]') as HTMLElement) + .hidden, + ).toBe(false) + }) + + test("Purchase without currency shows both inline errors and does not write back", async () => { + render() + await flush() + openDialog() + await flush() + + selectOption(select("eventName", "combobox"), "Purchase") + await flush() + + clickConfirm() + await flush() + + expect(container.textContent).toContain( + "Value is required for Purchase events", + ) + expect(container.textContent).toContain( + "Currency is required for Purchase events", + ) + expect(formApi?.getValues("step")).toEqual(defaultFields) + }) + + test("Cancel discards edits made in the dialog", async () => { + render() + await flush() + openDialog() + await flush() + + setInputValue(input("value"), "42") + await flush() + + clickCancel() + await flush() + + expect(formApi?.getValues("step")).toEqual(defaultFields) + expect( + (container.querySelector('[data-testid="dialog-content"]') as HTMLElement) + .hidden, + ).toBe(true) + }) + + test("Confirm writes the edited values back to the parent", async () => { + render() + await flush() + openDialog() + await flush() + + setInputValue(input("value"), "42") + setInputValue(input("currency"), "USD") + await flush() + + clickConfirm() + await flush() + + expect(formApi?.getValues("step")).toEqual({ + ...defaultFields, + value: "42", + currency: "USD", + }) + expect( + (container.querySelector('[data-testid="dialog-content"]') as HTMLElement) + .hidden, + ).toBe(true) + }) + + test("reopening after Confirm shows the confirmed values", async () => { + render() + await flush() + openDialog() + await flush() + + setInputValue(input("value"), "42") + setInputValue(input("currency"), "USD") + await flush() + clickConfirm() + await flush() + + openDialog() + await flush() + + expect(input("value").value).toBe("42") + expect(input("currency").value).toBe("USD") + }) + + test("reopening after Cancel shows the parent's values", async () => { + render() + await flush() + openDialog() + await flush() + + setInputValue(input("value"), "999") + await flush() + clickCancel() + await flush() + + openDialog() + await flush() + + expect(input("value").value).toBe("") + }) + + test("a rapid close→reopen still shows the parent's values (keyed remount)", async () => { + render({ ...defaultFields, value: "100", currency: "USD" }) + await flush() + openDialog() + await flush() + + expect(input("value").value).toBe("100") + + // Edit the child form only — never confirmed. + setInputValue(input("value"), "999") + await flush() + + // Close without saving, then reopen immediately. The mocked + // DialogContent never unmounts (see module mock above), so only the + // `key={openCount}` remount in `MetaCapiEventDialog` can refresh the + // stale, uncontrolled `PlainTextEditorField` stand-in. + clickCancel() + openDialog() + await flush() + + expect(input("value").value).toBe("100") + }) + + test('with "email" selected, "Custom event…" reveals the input and a custom name round-trips', async () => { + render() + await flush() + openDialog() + await flush() + + selectOption(select("actionSource"), "email") + await flush() + + selectOption(select("eventName", "combobox"), "__custom__") + await flush() + + const customNameInput = container.querySelector( + 'input[name="eventName"]', + ) as HTMLInputElement + expect(customNameInput).toBeTruthy() + + setInputValue(customNameInput, "MyCustomEvent") + await flush() + + clickConfirm() + await flush() + + expect(formApi?.getValues("step.actionSource")).toBe("email") + expect(formApi?.getValues("step.eventName")).toBe("MyCustomEvent") + }) + + test('choosing "Custom event…" shows no error until Confirm, then exactly one', async () => { + render() + await flush() + openDialog() + await flush() + + selectOption(select("actionSource"), "email") + await flush() + selectOption(select("eventName", "combobox"), "__custom__") + await flush() + + const errorText = "Too small: expected string to have >=1 characters" + expect(container.textContent).not.toContain(errorText) + + clickConfirm() + await flush() + + const occurrences = container.textContent?.split(errorText).length ?? 1 + expect(occurrences - 1).toBe(1) + expect(formApi?.getValues("step")).toEqual(defaultFields) + }) + + test('with "business_messaging" selected there is no "Custom event…" entry', async () => { + render() + await flush() + openDialog() + await flush() + + const options = Array.from( + select("eventName", "combobox").querySelectorAll("option"), + ).map((option) => option.textContent) + + expect(options).not.toContain("metaConversions.fields.eventType.custom") + }) + + test("switching email (Lead) to business_messaging resets the event to LeadSubmitted", async () => { + render({ ...defaultFields, actionSource: "email", eventName: "Lead" }) + await flush() + openDialog() + await flush() + + selectOption(select("actionSource"), "business_messaging") + await flush() + clickConfirm() + await flush() + + expect(formApi?.getValues("step.eventName")).toBe("LeadSubmitted") + }) + + test("switching business_messaging (Purchase) to email keeps Purchase", async () => { + // Purchase requires value+currency regardless of action source, so the + // initial fixture must already satisfy that or Confirm would fail + // validation for an unrelated reason. + render({ + ...defaultFields, + actionSource: "business_messaging", + eventName: "Purchase", + value: "42", + currency: "USD", + }) + await flush() + openDialog() + await flush() + + selectOption(select("actionSource"), "email") + await flush() + clickConfirm() + await flush() + + expect(formApi?.getValues("step.eventName")).toBe("Purchase") + expect(formApi?.getValues("step.actionSource")).toBe("email") + }) + + test("the Advanced section is collapsed by default", async () => { + render() + await flush() + openDialog() + await flush() + + expect( + container.querySelector('[data-testid="advanced-content"]'), + ).toBeNull() + }) + + test("a legacy parent value with no actionSource opens pre-selected to business_messaging and confirm writes it back", async () => { + // Flow versions saved before `actionSource` existed carry no value for + // it at all, and the dialog restores the parent's raw value into the + // child form on open (no zod defaults) — this simulates that shape. + const { actionSource: _actionSource, ...legacyFields } = defaultFields + const legacyValue = legacyFields as MetaCapiEventFieldsSchema + + render(legacyValue) + await flush() + openDialog() + await flush() + + expect(select("actionSource").value).toBe("business_messaging") + + clickConfirm() + await flush() + + expect(formApi?.getValues("step.actionSource")).toBe("business_messaging") + }) +}) diff --git a/apps/builder/__tests__/trigger-send-meta-capi-event-schema.test.ts b/apps/builder/__tests__/trigger-send-meta-capi-event-schema.test.ts new file mode 100644 index 0000000000..ab0f1444a8 --- /dev/null +++ b/apps/builder/__tests__/trigger-send-meta-capi-event-schema.test.ts @@ -0,0 +1,74 @@ +import { describe, expect, test } from "vitest" +import { + defaultFn, + sendMetaCapiEvent, +} from "@/features/triggers/components/actions/schema/send-meta-capi-event" + +describe("trigger send Meta CAPI event action schema", () => { + test("rejects Purchase without value or currency", () => { + const result = sendMetaCapiEvent.safeParse({ + ...defaultFn(), + eventName: "Purchase", + }) + + expect(result.success).toBe(false) + }) + + test("accepts Purchase with both value and currency", () => { + const result = sendMetaCapiEvent.safeParse({ + ...defaultFn(), + eventName: "Purchase", + value: "10", + currency: "USD", + }) + + expect(result.success).toBe(true) + }) + + test("applies defaults for a stored action with only the old five fields", () => { + const result = sendMetaCapiEvent.safeParse({ + type: "sendMetaCapiEvent", + eventName: "LeadSubmitted", + value: "10", + currency: "USD", + contentCategory: "Education", + contentName: "Course", + }) + + expect(result.success).toBe(true) + expect(result.data).toMatchObject({ + actionSource: "business_messaging", + eventName: "LeadSubmitted", + value: "10", + currency: "USD", + contentCategory: "Education", + contentName: "Course", + }) + }) + + test("accepts a custom event name for the email action source", () => { + const result = sendMetaCapiEvent.safeParse({ + ...defaultFn(), + actionSource: "email", + eventName: "my-custom-event", + }) + + expect(result.success).toBe(true) + }) + + test("rejects a pixel-only event name (Lead) for business_messaging", () => { + const result = sendMetaCapiEvent.safeParse({ + ...defaultFn(), + actionSource: "business_messaging", + eventName: "Lead", + }) + + expect(result.success).toBe(false) + }) + + test("defaultFn() parses", () => { + const result = sendMetaCapiEvent.safeParse(defaultFn()) + + expect(result.success).toBe(true) + }) +}) diff --git a/apps/builder/__tests__/update-trigger-action.test.ts b/apps/builder/__tests__/update-trigger-action.test.ts index 5f2e3d836c..f3bc576232 100644 --- a/apps/builder/__tests__/update-trigger-action.test.ts +++ b/apps/builder/__tests__/update-trigger-action.test.ts @@ -162,7 +162,7 @@ describe("updateTriggerAction", () => { expect(tx.delete).not.toHaveBeenCalled() expect(tx.insert).not.toHaveBeenCalled() // Cache invalidation must not be gated on the diff result — only the - // audit record should be. See docs/plans/pr-1033-audit-log-fix-groups-1-4-5.md. + // audit record should be. expect(mocks.updateTriggerCache).toHaveBeenCalledWith("workspace-1") expect(mocks.auditRecord).not.toHaveBeenCalled() }) diff --git a/apps/builder/messages/ar.json b/apps/builder/messages/ar.json index 9b4863f173..0c6c2b6667 100644 --- a/apps/builder/messages/ar.json +++ b/apps/builder/messages/ar.json @@ -2328,8 +2328,7 @@ "import": "استيراد التدفق", "export": "تصدير", "importStarted": "جارٍ استيراد التدفق. يرجى مراجعة سجل الاستيراد للحصول على النتائج.", - "importJsonOnly": "ملفات JSON فقط", - "adsConversions": "الإعلانات وتحويلات Meta" + "importJsonOnly": "ملفات JSON فقط" }, "splitTraffic": { "balanceHint": "يجب أن يساوي مجموع النسب 100%.", @@ -4241,11 +4240,6 @@ "description": "قم بتوصيل حساب القناة أولاً، ثم عد إلى هنا لإنشاء الإعلانات.", "cta": "الانتقال إلى إعدادات القناة" }, - "movedNote": { - "title": "انتقلت الإعلانات إلى الأدوات", - "description": "أنشئ وأدر إعلانات Click-to-Message من أداة إعلانات Click-to-Message.", - "cta": "فتح إعلانات Click-to-Message" - }, "dashboardCta": "عرض على لوحة معلومات الإعلانات" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "إرسال أحداث LeadSubmitted من محادثات Messenger وInstagram وWhatsApp إلى Meta.", + "description": "إرسال أحداث تحويل من محادثات Messenger وInstagram وWhatsApp إلى Meta.", "datasetId": "معرف Dataset", "reconnect": "إعادة ربط الصلاحيات", "connectViaFacebook": "ربط عبر Facebook", "unsupportedExplanation": "تم ربط حساب Instagram هذا باستخدام تسجيل دخول Instagram للأعمال. اربط الحساب عبر Facebook لاستخدام Meta Conversions API.", "flowStep": { - "description": "إضافة حدث LeadSubmitted إلى قائمة الانتظار لـ Messenger أو Instagram أو WhatsApp.", "whatsappNote": "تُرسل أحداث WhatsApp فقط للمحادثات التي بدأت من إعلان النقر للمحادثة عبر WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "احفظ معرف Dataset قبل إضافة رمز وصول.", "invalidToken": "تعذّر على هذا الرمز الوصول إلى Dataset.", "invalidDatasetId": "أدخل معرّف مجموعة بيانات صالحًا (أرقام فقط).", - "whatsappNotFound": "لم يتم العثور على اتصال WhatsApp." + "whatsappNotFound": "لم يتم العثور على اتصال WhatsApp.", + "testEventCodeRequired": "احفظ رمز حدث اختبار قبل إرسال حدث اختبار.", + "noContactForTest": "لا توجد جهة اتصال مؤهلة على هذه القناة بعد. يحتاج الحدث التجريبي إلى جهة اتصال حقيقية لربطه بها (في WhatsApp، يجب أن تأتي من إعلان click-to-WhatsApp).", + "invalidTestEventCode": "يجب ألا يحتوي رمز حدث الاختبار إلا على أحرف وأرقام وشرطات أو شرطات سفلية (بحد أقصى 64)." }, "fields": { "eventType": { "label": "نوع الحدث", - "leadSubmitted": "تم إرسال عميل محتمل" + "leadSubmitted": "تم إرسال عميل محتمل", + "purchase": "شراء", + "initiateCheckout": "بدء الدفع", + "addToCart": "إضافة إلى السلة", + "viewContent": "عرض المحتوى", + "orderCreated": "تم إنشاء الطلب", + "orderShipped": "تم شحن الطلب", + "orderDelivered": "تم توصيل الطلب", + "orderCanceled": "تم إلغاء الطلب", + "orderReturned": "تم إرجاع الطلب", + "cartAbandoned": "التخلي عن السلة", + "qualifiedLead": "عميل محتمل مؤهل", + "ratingProvided": "تم تقديم تقييم", + "reviewProvided": "تم تقديم مراجعة", + "addPaymentInfo": "إضافة معلومات الدفع", + "addToWishlist": "إضافة إلى المفضلة", + "completeRegistration": "إتمام التسجيل", + "contact": "تواصل", + "customizeProduct": "تخصيص المنتج", + "donate": "تبرع", + "findLocation": "البحث عن موقع", + "lead": "عميل محتمل", + "schedule": "جدولة موعد", + "search": "بحث", + "startTrial": "بدء الفترة التجريبية", + "submitApplication": "تقديم الطلب", + "subscribe": "اشتراك", + "custom": "حدث مخصص…", + "groups": { + "commerce": "التجارة", + "leads": "العملاء المحتملون", + "orders": "الطلبات", + "feedback": "الملاحظات", + "leadsAndSignups": "العملاء المحتملون والتسجيلات", + "other": "أخرى" + } }, "value": "القيمة", "valuePlaceholder": "مثال: 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "اسم الحدث المخصص", + "customEventNamePlaceholder": "مثال: MyCustomEvent", + "contentType": { + "label": "نوع المحتوى", + "product": "منتج", + "product_group": "مجموعة منتجات" + }, + "contentIds": "معرّفات المحتوى", + "contentIdsPlaceholder": "مثال: 123,456" }, "datasetIdPlaceholder": "الصق معرف Dataset من Events Manager", "saveDataset": "حفظ", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "مصدر الإجراء", + "help": "أين حدث هذا الحدث. راجع وثائق مصدر الإجراء من Meta.", + "business_messaging": "مراسلة الأعمال", + "email": "البريد الإلكتروني", + "phone_call": "مكالمة هاتفية", + "chat": "محادثة", + "physical_store": "متجر فعلي", + "system_generated": "تم إنشاؤه بواسطة النظام", + "other": "أخرى" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "خيارات متقدمة" + }, + "testEvents": { + "title": "اختبار الأحداث", + "description": "الصق test_event_code من Events Manager ← Test events. أثناء ضبطه، يتم توجيه كل حدث من هذه القناة إلى عرض Test events مع كامل بياناته (القيمة، العملة، معرّفات المحتوى) ولا يُحتسب في التقارير. امسحه عند الانتهاء.", + "codeLabel": "رمز حدث الاختبار", + "codePlaceholder": "مثال: TEST12345", + "save": "حفظ الرمز", + "clear": "مسح", + "saved": "تم حفظ رمز حدث الاختبار.", + "cleared": "تم مسح رمز حدث الاختبار. الأحداث نشطة مجددًا.", + "send": "إرسال حدث اختبار", + "sent": "تم إدراج حدث الاختبار في قائمة الانتظار. سيظهر ضمن Test events في Events Manager خلال دقيقة.", + "sendHint": "يرسل حدث Purchase تجريبيًا واحدًا (100 USD) إلى أحدث جهة اتصال في هذه القناة.", + "activeNotice": "وضع الاختبار مفعّل: لا تُحتسب أحداث هذه القناة في التقارير حتى يتم مسح الرمز.", + "openTestEvents": "فتح Test events" } }, "minigames": { diff --git a/apps/builder/messages/da.json b/apps/builder/messages/da.json index 654c1eb958..a36d55317c 100644 --- a/apps/builder/messages/da.json +++ b/apps/builder/messages/da.json @@ -2254,8 +2254,7 @@ "import": "Importer flow", "export": "Eksporter", "importStarted": "Flowet importeres. Tjek importhistorikken for resultater.", - "importJsonOnly": "Kun JSON-filer", - "adsConversions": "Annoncer og Meta Conversions" + "importJsonOnly": "Kun JSON-filer" }, "splitTraffic": { "balanceHint": "Den i alt sum must equal 100%.", @@ -4406,11 +4405,6 @@ "description": "Tilslut en kanalkonto først, og kom derefter tilbage hertil for at oprette annoncer.", "cta": "Gå til kanalindstillinger" }, - "movedNote": { - "title": "Annoncer er flyttet til Værktøjer", - "description": "Opret og administrer Click-to-Message-annoncer fra værktøjet Click-to-Message-annoncer.", - "cta": "Åbn Click-to-Message-annoncer" - }, "dashboardCta": "Se på annoncepanelet" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Send LeadSubmitted-hændelser fra Messenger-, Instagram- og WhatsApp-samtaler til Meta.", + "description": "Send konverteringshændelser fra Messenger-, Instagram- og WhatsApp-samtaler til Meta.", "datasetId": "Dataset-ID", "reconnect": "Genopret tilladelser", "connectViaFacebook": "Forbind via Facebook", "unsupportedExplanation": "Denne Instagram-konto blev forbundet med Instagram Business Login. Forbind kontoen via Facebook for at bruge Meta Conversions API.", "flowStep": { - "description": "Sæt en LeadSubmitted-hændelse i kø til Messenger, Instagram eller WhatsApp.", "whatsappNote": "WhatsApp-hændelser sendes kun for samtaler, der er startet fra en click-to-WhatsApp-annonce." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Gem et Dataset-ID, før du tilføjer en adgangstoken.", "invalidToken": "Denne token kunne ikke tilgå datasættet.", "invalidDatasetId": "Indtast et gyldigt Dataset ID (kun tal).", - "whatsappNotFound": "WhatsApp-integration ikke fundet." + "whatsappNotFound": "WhatsApp-integration ikke fundet.", + "testEventCodeRequired": "Gem en testhændelseskode, før du sender en testhændelse.", + "noContactForTest": "Ingen egnet kontakt på denne kanal endnu. En testhændelse kræver en rigtig kontakt at tilknytte (for WhatsApp en, der kom fra en click-to-WhatsApp-annonce).", + "invalidTestEventCode": "Testhændelseskoden må kun indeholde bogstaver, tal, bindestreger eller understregninger (maks. 64)." }, "fields": { "eventType": { "label": "Hændelsestype", - "leadSubmitted": "Lead indsendt" + "leadSubmitted": "Lead indsendt", + "purchase": "Køb", + "initiateCheckout": "Start af betaling", + "addToCart": "Læg i kurv", + "viewContent": "Vis indhold", + "orderCreated": "Ordre oprettet", + "orderShipped": "Ordre afsendt", + "orderDelivered": "Ordre leveret", + "orderCanceled": "Ordre annulleret", + "orderReturned": "Ordre returneret", + "cartAbandoned": "Kurv opgivet", + "qualifiedLead": "Kvalificeret lead", + "ratingProvided": "Bedømmelse angivet", + "reviewProvided": "Anmeldelse angivet", + "addPaymentInfo": "Tilføj betalingsoplysninger", + "addToWishlist": "Føj til ønskeliste", + "completeRegistration": "Gennemført registrering", + "contact": "Kontakt", + "customizeProduct": "Tilpas produkt", + "donate": "Donér", + "findLocation": "Find placering", + "lead": "Lead", + "schedule": "Book tid", + "search": "Søgning", + "startTrial": "Start prøveperiode", + "submitApplication": "Indsend ansøgning", + "subscribe": "Abonnér", + "custom": "Brugerdefineret hændelse…", + "groups": { + "commerce": "Handel", + "leads": "Leads", + "orders": "Ordrer", + "feedback": "Feedback", + "leadsAndSignups": "Leads og tilmeldinger", + "other": "Andet" + } }, "value": "Værdi", "valuePlaceholder": "f.eks. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Navn på brugerdefineret hændelse", + "customEventNamePlaceholder": "fx MyCustomEvent", + "contentType": { + "label": "Indholdstype", + "product": "Produkt", + "product_group": "Produktgruppe" + }, + "contentIds": "Indholds-ID'er", + "contentIdsPlaceholder": "fx 123,456" }, "datasetIdPlaceholder": "Indsæt Dataset-ID fra Events Manager", "saveDataset": "Gem", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Handlingskilde", + "help": "Hvor denne hændelse fandt sted. Se Metas dokumentation om handlingskilder.", + "business_messaging": "Virksomhedsbeskeder", + "email": "E-mail", + "phone_call": "Telefonopkald", + "chat": "Chat", + "physical_store": "Fysisk butik", + "system_generated": "Systemgenereret", + "other": "Andet" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avanceret" + }, + "testEvents": { + "title": "Testhændelser", + "description": "Indsæt test_event_code fra Events Manager → Test events. Mens den er angivet, dirigeres alle hændelser fra denne kanal til Test events-visningen med den fulde nyttelast (værdi, valuta, indholds-id'er) og tælles ikke med i rapporter. Ryd den, når du er færdig.", + "codeLabel": "Testhændelseskode", + "codePlaceholder": "f.eks. TEST12345", + "save": "Gem kode", + "clear": "Ryd", + "saved": "Testhændelseskode gemt.", + "cleared": "Testhændelseskode ryddet. Hændelser er live igen.", + "send": "Send testhændelse", + "sent": "Testhændelse sat i kø. Den vises under Test events i Events Manager inden for et minut.", + "sendHint": "Sender ét eksempel på Purchase (100 USD) til denne kanals seneste kontakt.", + "activeNotice": "Testtilstand er slået til: hændelser fra denne kanal tælles ikke med i rapporter, før koden ryddes.", + "openTestEvents": "Åbn Test events" } }, "minigames": { diff --git a/apps/builder/messages/de.json b/apps/builder/messages/de.json index 3d4e12a93f..663b2b5180 100644 --- a/apps/builder/messages/de.json +++ b/apps/builder/messages/de.json @@ -2254,8 +2254,7 @@ "import": "Flow importieren", "export": "Exportieren", "importStarted": "Der Flow wird importiert. Ergebnisse im Importverlauf prüfen.", - "importJsonOnly": "Nur JSON-Dateien", - "adsConversions": "Anzeigen & Meta Conversions" + "importJsonOnly": "Nur JSON-Dateien" }, "splitTraffic": { "balanceHint": "Die Gesamtsumme muss 100 % ergeben.", @@ -4406,11 +4405,6 @@ "description": "Verbinden Sie zuerst ein Kanalkonto und kommen Sie dann hierher zurück, um Anzeigen zu erstellen.", "cta": "Zu den Kanaleinstellungen" }, - "movedNote": { - "title": "Anzeigen wurden zu Tools verschoben", - "description": "Erstellen und verwalten Sie Click-to-Message-Anzeigen über das Tool Click-to-Message-Anzeigen.", - "cta": "Click-to-Message-Anzeigen öffnen" - }, "dashboardCta": "Im Anzeigen-Dashboard ansehen" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Senden Sie LeadSubmitted-Ereignisse aus Messenger-, Instagram- und WhatsApp-Unterhaltungen an Meta.", + "description": "Senden Sie Conversion-Ereignisse aus Messenger-, Instagram- und WhatsApp-Unterhaltungen an Meta.", "datasetId": "Dataset-ID", "reconnect": "Berechtigungen erneuern", "connectViaFacebook": "Über Facebook verbinden", "unsupportedExplanation": "Dieses Instagram-Konto wurde mit Instagram Business Login verbunden. Verbinden Sie das Konto über Facebook, um die Meta Conversions API zu nutzen.", "flowStep": { - "description": "Stellt ein LeadSubmitted-Ereignis für Messenger, Instagram oder WhatsApp in die Warteschlange.", "whatsappNote": "WhatsApp-Ereignisse werden nur für Unterhaltungen gesendet, die über eine Click-to-WhatsApp-Anzeige gestartet wurden." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Speichern Sie eine Dataset-ID, bevor Sie ein Zugriffstoken hinzufügen.", "invalidToken": "Mit diesem Token konnte nicht auf das Dataset zugegriffen werden.", "invalidDatasetId": "Gib eine gültige Dataset-ID ein (nur Zahlen).", - "whatsappNotFound": "WhatsApp-Integration nicht gefunden." + "whatsappNotFound": "WhatsApp-Integration nicht gefunden.", + "testEventCodeRequired": "Speichere einen Testereignis-Code, bevor du ein Testereignis sendest.", + "noContactForTest": "Noch kein geeigneter Kontakt in diesem Kanal. Ein Testereignis braucht einen echten Kontakt zur Zuordnung (bei WhatsApp einen aus einer Click-to-WhatsApp-Anzeige).", + "invalidTestEventCode": "Der Testereignis-Code darf nur Buchstaben, Ziffern, Bindestriche oder Unterstriche enthalten (max. 64)." }, "fields": { "eventType": { "label": "Ereignistyp", - "leadSubmitted": "Lead übermittelt" + "leadSubmitted": "Lead übermittelt", + "purchase": "Kauf", + "initiateCheckout": "Bezahlvorgang gestartet", + "addToCart": "In den Warenkorb", + "viewContent": "Inhalt ansehen", + "orderCreated": "Bestellung erstellt", + "orderShipped": "Bestellung versendet", + "orderDelivered": "Bestellung zugestellt", + "orderCanceled": "Bestellung storniert", + "orderReturned": "Bestellung zurückgesendet", + "cartAbandoned": "Warenkorbabbruch", + "qualifiedLead": "Qualifizierter Lead", + "ratingProvided": "Bewertung abgegeben", + "reviewProvided": "Rezension abgegeben", + "addPaymentInfo": "Zahlungsinfo hinzugefügt", + "addToWishlist": "Zur Wunschliste hinzufügen", + "completeRegistration": "Registrierung abgeschlossen", + "contact": "Kontakt", + "customizeProduct": "Produkt anpassen", + "donate": "Spenden", + "findLocation": "Standort finden", + "lead": "Lead", + "schedule": "Termin buchen", + "search": "Suche", + "startTrial": "Testphase starten", + "submitApplication": "Bewerbung einreichen", + "subscribe": "Abonnieren", + "custom": "Benutzerdefiniertes Ereignis…", + "groups": { + "commerce": "Handel", + "leads": "Leads", + "orders": "Bestellungen", + "feedback": "Feedback", + "leadsAndSignups": "Leads & Anmeldungen", + "other": "Sonstige" + } }, "value": "Wert", "valuePlaceholder": "z. B. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Name des benutzerdefinierten Ereignisses", + "customEventNamePlaceholder": "z. B. MyCustomEvent", + "contentType": { + "label": "Inhaltstyp", + "product": "Produkt", + "product_group": "Produktgruppe" + }, + "contentIds": "Inhalts-IDs", + "contentIdsPlaceholder": "z. B. 123,456" }, "datasetIdPlaceholder": "Dataset-ID aus dem Events Manager einfügen", "saveDataset": "Speichern", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Aktionsquelle", + "help": "Wo dieses Ereignis stattgefunden hat. Siehe Metas Dokumentation zur Aktionsquelle.", + "business_messaging": "Business Messaging", + "email": "E-Mail", + "phone_call": "Telefonanruf", + "chat": "Chat", + "physical_store": "Ladengeschäft", + "system_generated": "Systemgeneriert", + "other": "Sonstige" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Erweitert" + }, + "testEvents": { + "title": "Testereignisse", + "description": "Füge den test_event_code aus Events Manager → Test events ein. Solange er gesetzt ist, wird jedes Ereignis dieses Kanals mit vollständiger Nutzlast (Wert, Währung, Inhalts-IDs) an die Test events-Ansicht weitergeleitet und nicht in Berichten gezählt. Lösche ihn, wenn du fertig bist.", + "codeLabel": "Testereignis-Code", + "codePlaceholder": "z. B. TEST12345", + "save": "Code speichern", + "clear": "Löschen", + "saved": "Testereignis-Code gespeichert.", + "cleared": "Testereignis-Code gelöscht. Ereignisse sind wieder live.", + "send": "Testereignis senden", + "sent": "Testereignis wurde eingereiht. Es erscheint innerhalb einer Minute unter Test events im Events Manager.", + "sendHint": "Sendet einen Beispiel-Purchase (100 USD) an den letzten Kontakt dieses Kanals.", + "activeNotice": "Testmodus ist aktiv: Ereignisse dieses Kanals werden erst wieder in Berichten gezählt, wenn der Code gelöscht wird.", + "openTestEvents": "Test events öffnen" } }, "minigames": { diff --git a/apps/builder/messages/en.json b/apps/builder/messages/en.json index 22783ad1ba..e3481a7fbe 100644 --- a/apps/builder/messages/en.json +++ b/apps/builder/messages/en.json @@ -2192,11 +2192,10 @@ }, "metaConversions": { "flowStep": { - "description": "Queue a LeadSubmitted event for Messenger, Instagram, or WhatsApp.", "whatsappNote": "WhatsApp events only send for conversations that started from a click-to-WhatsApp ad." }, "title": "Conversions API", - "description": "Send LeadSubmitted events from Messenger, Instagram, and WhatsApp conversations to Meta.", + "description": "Send conversion events from Messenger, Instagram, and WhatsApp conversations to Meta.", "datasetId": "Dataset ID", "reconnect": "Reconnect permissions", "connectViaFacebook": "Connect via Facebook", @@ -2225,12 +2224,50 @@ "datasetRequired": "Save a Dataset ID before adding an access token.", "invalidToken": "This token could not access the dataset.", "invalidDatasetId": "Enter a valid Dataset ID (numbers only).", - "whatsappNotFound": "WhatsApp integration not found." + "whatsappNotFound": "WhatsApp integration not found.", + "testEventCodeRequired": "Save a test event code before sending a test event.", + "noContactForTest": "No eligible contact on this channel yet. A test event needs a real contact to attribute to (for WhatsApp, one that came from a click-to-WhatsApp ad).", + "invalidTestEventCode": "Test event code may only contain letters, digits, dashes or underscores (max 64)." }, "fields": { "eventType": { "label": "Event type", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "Purchase", + "initiateCheckout": "Initiate Checkout", + "addToCart": "Add To Cart", + "viewContent": "View Content", + "orderCreated": "Order Created", + "orderShipped": "Order Shipped", + "orderDelivered": "Order Delivered", + "orderCanceled": "Order Canceled", + "orderReturned": "Order Returned", + "cartAbandoned": "Cart Abandoned", + "qualifiedLead": "Qualified Lead", + "ratingProvided": "Rating Provided", + "reviewProvided": "Review Provided", + "addPaymentInfo": "Add Payment Info", + "addToWishlist": "Add To Wishlist", + "completeRegistration": "Complete Registration", + "contact": "Contact", + "customizeProduct": "Customize Product", + "donate": "Donate", + "findLocation": "Find Location", + "lead": "Lead", + "schedule": "Schedule", + "search": "Search", + "startTrial": "Start Trial", + "submitApplication": "Submit Application", + "subscribe": "Subscribe", + "custom": "Custom event…", + "groups": { + "commerce": "Commerce", + "leads": "Leads", + "orders": "Orders", + "feedback": "Feedback", + "leadsAndSignups": "Leads & Sign-ups", + "other": "Other" + } }, "value": "Value", "valuePlaceholder": "e.g. 250", @@ -2248,7 +2285,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Custom event name", + "customEventNamePlaceholder": "e.g. MyCustomEvent", + "contentType": { + "label": "Content type", + "product": "Product", + "product_group": "Product Group" + }, + "contentIds": "Content IDs", + "contentIdsPlaceholder": "e.g. 123,456" }, "datasetIdPlaceholder": "Paste Dataset ID from Events Manager", "saveDataset": "Save", @@ -2299,6 +2345,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Action source", + "help": "Where this event took place. See Meta's action source documentation.", + "business_messaging": "Business Messaging", + "email": "Email", + "phone_call": "Phone Call", + "chat": "Chat", + "physical_store": "Physical Store", + "system_generated": "System Generated", + "other": "Other" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Advanced" + }, + "testEvents": { + "title": "Test events", + "description": "Paste the test_event_code from Events Manager → Test events. While it is set, every event from this channel is routed to the Test events view with its full payload (value, currency, content IDs) and is not counted in reports. Clear it when you are done.", + "codeLabel": "Test event code", + "codePlaceholder": "e.g. TEST12345", + "save": "Save code", + "clear": "Clear", + "saved": "Test event code saved.", + "cleared": "Test event code cleared. Events are live again.", + "send": "Send test event", + "sent": "Test event queued. It appears under Test events in Events Manager within a minute.", + "sendHint": "Sends one sample Purchase (100 USD) to this channel's most recent contact.", + "activeNotice": "Test mode is on: events from this channel are not counted in reports until the code is cleared.", + "openTestEvents": "Open Test events" } }, "flows": { @@ -2439,8 +2515,7 @@ "import": "Import Flow", "export": "Export", "importStarted": "Flow is importing. Check the import history for results.", - "importJsonOnly": "JSON files only", - "adsConversions": "Ads & Meta Conversions" + "importJsonOnly": "JSON files only" }, "splitTraffic": { "balanceHint": "The total sum must equal 100%.", @@ -4560,11 +4635,6 @@ "description": "Connect a channel account first, then come back here to create ads.", "cta": "Go to channel settings" }, - "movedNote": { - "title": "Ads have moved to Tools", - "description": "Create and manage Click to Message ads from the Click to Message Ads tool.", - "cta": "Open Click to Message Ads" - }, "dashboardCta": "View on Ads dashboard" }, "ecommerce": { diff --git a/apps/builder/messages/es.json b/apps/builder/messages/es.json index 5f19ad2908..90a733f4b5 100644 --- a/apps/builder/messages/es.json +++ b/apps/builder/messages/es.json @@ -2328,8 +2328,7 @@ "import": "Importar flujo", "export": "Exportar", "importStarted": "El flujo se está importando. Consulta el historial de importaciones para ver los resultados.", - "importJsonOnly": "Solo archivos JSON", - "adsConversions": "Anuncios y Meta Conversions" + "importJsonOnly": "Solo archivos JSON" }, "splitTraffic": { "balanceHint": "La suma total debe ser igual al 100 %.", @@ -4406,11 +4405,6 @@ "description": "Conecta primero una cuenta de canal y luego vuelve aquí para crear anuncios.", "cta": "Ir a la configuración del canal" }, - "movedNote": { - "title": "Los anuncios se han movido a Herramientas", - "description": "Crea y gestiona los anuncios Click-to-Message desde la herramienta Anuncios Click-to-Message.", - "cta": "Abrir Anuncios Click-to-Message" - }, "dashboardCta": "Ver en el panel de anuncios" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Envía eventos LeadSubmitted desde conversaciones de Messenger, Instagram y WhatsApp a Meta.", + "description": "Envía eventos de conversión desde conversaciones de Messenger, Instagram y WhatsApp a Meta.", "datasetId": "ID del conjunto de datos", "reconnect": "Reconectar permisos", "connectViaFacebook": "Conectar mediante Facebook", "unsupportedExplanation": "Esta cuenta de Instagram se conectó con Instagram Business Login. Conecta la cuenta mediante Facebook para usar Meta Conversions API.", "flowStep": { - "description": "Encola un evento LeadSubmitted para Messenger, Instagram o WhatsApp.", "whatsappNote": "Los eventos de WhatsApp solo se envían para conversaciones que comenzaron desde un anuncio click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Guarda un ID de conjunto de datos antes de añadir un token de acceso.", "invalidToken": "Este token no pudo acceder al conjunto de datos.", "invalidDatasetId": "Introduce un Dataset ID válido (solo números).", - "whatsappNotFound": "No se encontró la integración de WhatsApp." + "whatsappNotFound": "No se encontró la integración de WhatsApp.", + "testEventCodeRequired": "Guarda un código de evento de prueba antes de enviar un evento de prueba.", + "noContactForTest": "Aún no hay un contacto apto en este canal. Un evento de prueba necesita un contacto real al que atribuirse (en WhatsApp, uno que provenga de un anuncio click-to-WhatsApp).", + "invalidTestEventCode": "El código de evento de prueba solo puede contener letras, números, guiones o guiones bajos (máx. 64)." }, "fields": { "eventType": { "label": "Tipo de evento", - "leadSubmitted": "Lead enviado" + "leadSubmitted": "Lead enviado", + "purchase": "Compra", + "initiateCheckout": "Iniciar pago", + "addToCart": "Añadir al carrito", + "viewContent": "Ver contenido", + "orderCreated": "Pedido creado", + "orderShipped": "Pedido enviado", + "orderDelivered": "Pedido entregado", + "orderCanceled": "Pedido cancelado", + "orderReturned": "Pedido devuelto", + "cartAbandoned": "Carrito abandonado", + "qualifiedLead": "Lead calificado", + "ratingProvided": "Valoración proporcionada", + "reviewProvided": "Reseña proporcionada", + "addPaymentInfo": "Añadir información de pago", + "addToWishlist": "Añadir a la lista de deseos", + "completeRegistration": "Registro completado", + "contact": "Contacto", + "customizeProduct": "Personalizar producto", + "donate": "Donar", + "findLocation": "Buscar ubicación", + "lead": "Lead", + "schedule": "Programar", + "search": "Búsqueda", + "startTrial": "Iniciar prueba", + "submitApplication": "Enviar solicitud", + "subscribe": "Suscribirse", + "custom": "Evento personalizado…", + "groups": { + "commerce": "Comercio", + "leads": "Leads", + "orders": "Pedidos", + "feedback": "Comentarios", + "leadsAndSignups": "Leads y registros", + "other": "Otros" + } }, "value": "Valor", "valuePlaceholder": "p. ej. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nombre del evento personalizado", + "customEventNamePlaceholder": "p. ej. MyCustomEvent", + "contentType": { + "label": "Tipo de contenido", + "product": "Producto", + "product_group": "Grupo de productos" + }, + "contentIds": "ID de contenido", + "contentIdsPlaceholder": "p. ej. 123,456" }, "datasetIdPlaceholder": "Pega el ID del conjunto de datos desde Events Manager", "saveDataset": "Guardar", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Origen de la acción", + "help": "Dónde ocurrió este evento. Consulta la documentación de Meta sobre el origen de la acción.", + "business_messaging": "Mensajería empresarial", + "email": "Correo electrónico", + "phone_call": "Llamada telefónica", + "chat": "Chat", + "physical_store": "Tienda física", + "system_generated": "Generado por el sistema", + "other": "Otros" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avanzado" + }, + "testEvents": { + "title": "Eventos de prueba", + "description": "Pega el test_event_code de Events Manager → Test events. Mientras esté configurado, cada evento de este canal se enruta a la vista Test events con su payload completo (valor, moneda, IDs de contenido) y no se cuenta en los informes. Bórralo cuando termines.", + "codeLabel": "Código de evento de prueba", + "codePlaceholder": "p. ej. TEST12345", + "save": "Guardar código", + "clear": "Borrar", + "saved": "Código de evento de prueba guardado.", + "cleared": "Código de evento de prueba borrado. Los eventos vuelven a estar en vivo.", + "send": "Enviar evento de prueba", + "sent": "Evento de prueba en cola. Aparecerá en Test events dentro de Events Manager en un minuto.", + "sendHint": "Envía un Purchase de muestra (100 USD) al contacto más reciente de este canal.", + "activeNotice": "El modo de prueba está activo: los eventos de este canal no se cuentan en los informes hasta que se borre el código.", + "openTestEvents": "Abrir Test events" } }, "minigames": { diff --git a/apps/builder/messages/fi.json b/apps/builder/messages/fi.json index 06a4c7b747..8ef058d13d 100644 --- a/apps/builder/messages/fi.json +++ b/apps/builder/messages/fi.json @@ -2254,8 +2254,7 @@ "import": "Tuo vuo", "export": "Vie", "importStarted": "Vuota tuodaan. Tarkista tuontihistoriasta tulokset.", - "importJsonOnly": "Vain JSON-tiedostot", - "adsConversions": "Mainokset ja Meta Conversions" + "importJsonOnly": "Vain JSON-tiedostot" }, "splitTraffic": { "balanceHint": "Kokonaissumman on oltava 100 %.", @@ -4406,11 +4405,6 @@ "description": "Yhdistä ensin kanavatili ja palaa sitten tänne luomaan mainoksia.", "cta": "Siirry kanava-asetuksiin" }, - "movedNote": { - "title": "Mainokset on siirretty Työkaluihin", - "description": "Luo ja hallitse Click-to-Message-mainoksia Click-to-Message-mainokset-työkalusta.", - "cta": "Avaa Click-to-Message-mainokset" - }, "dashboardCta": "Näytä mainostaulussa" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Lähetä LeadSubmitted-tapahtumia Messenger-, Instagram- ja WhatsApp-keskusteluista Metalle.", + "description": "Lähetä konversiotapahtumia Messenger-, Instagram- ja WhatsApp-keskusteluista Metalle.", "datasetId": "Tietojoukon tunnus", "reconnect": "Uusi käyttöoikeudet", "connectViaFacebook": "Yhdistä Facebookin kautta", "unsupportedExplanation": "Tämä Instagram-tili yhdistettiin Instagram Business -kirjautumisella. Yhdistä tili Facebookin kautta käyttääksesi Meta Conversions API:a.", "flowStep": { - "description": "Jonota LeadSubmitted-tapahtuma Messengerille, Instagramille tai WhatsAppille.", "whatsappNote": "WhatsApp-tapahtumat lähetetään vain keskusteluista, jotka alkoivat click-to-WhatsApp-mainoksesta." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Tallenna tietojoukon tunnus ennen käyttöoikeustunnuksen lisäämistä.", "invalidToken": "Tämä tunnus ei päässyt käsiksi tietojoukkoon.", "invalidDatasetId": "Anna kelvollinen Dataset ID (vain numeroita).", - "whatsappNotFound": "WhatsApp-integraatiota ei löytynyt." + "whatsappNotFound": "WhatsApp-integraatiota ei löytynyt.", + "testEventCodeRequired": "Tallenna testitapahtuman koodi ennen testitapahtuman lähettämistä.", + "noContactForTest": "Tällä kanavalla ei ole vielä sopivaa kontaktia. Testitapahtuma tarvitsee todellisen kontaktin (WhatsAppissa sellaisen, joka tuli click-to-WhatsApp-mainoksesta).", + "invalidTestEventCode": "Testitapahtuman koodi saa sisältää vain kirjaimia, numeroita, väliviivoja tai alaviivoja (enintään 64)." }, "fields": { "eventType": { "label": "Tapahtuman tyyppi", - "leadSubmitted": "Liidi lähetetty" + "leadSubmitted": "Liidi lähetetty", + "purchase": "Osto", + "initiateCheckout": "Kassalle siirtyminen", + "addToCart": "Lisää ostoskoriin", + "viewContent": "Sisällön katselu", + "orderCreated": "Tilaus luotu", + "orderShipped": "Tilaus lähetetty", + "orderDelivered": "Tilaus toimitettu", + "orderCanceled": "Tilaus peruutettu", + "orderReturned": "Tilaus palautettu", + "cartAbandoned": "Ostoskori hylätty", + "qualifiedLead": "Pätevä liidi", + "ratingProvided": "Arvio annettu", + "reviewProvided": "Arvostelu annettu", + "addPaymentInfo": "Lisää maksutiedot", + "addToWishlist": "Lisää toivelistalle", + "completeRegistration": "Rekisteröinti valmis", + "contact": "Yhteydenotto", + "customizeProduct": "Tuotteen mukauttaminen", + "donate": "Lahjoita", + "findLocation": "Etsi sijainti", + "lead": "Liidi", + "schedule": "Ajanvaraus", + "search": "Haku", + "startTrial": "Aloita kokeilu", + "submitApplication": "Lähetä hakemus", + "subscribe": "Tilaa", + "custom": "Mukautettu tapahtuma…", + "groups": { + "commerce": "Kauppa", + "leads": "Liidit", + "orders": "Tilaukset", + "feedback": "Palaute", + "leadsAndSignups": "Liidit ja rekisteröitymiset", + "other": "Muut" + } }, "value": "Arvo", "valuePlaceholder": "esim. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Mukautetun tapahtuman nimi", + "customEventNamePlaceholder": "esim. MyCustomEvent", + "contentType": { + "label": "Sisältötyyppi", + "product": "Tuote", + "product_group": "Tuoteryhmä" + }, + "contentIds": "Sisältötunnukset", + "contentIdsPlaceholder": "esim. 123,456" }, "datasetIdPlaceholder": "Liitä tietojoukon tunnus Events Managerista", "saveDataset": "Tallenna", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Toiminnon lähde", + "help": "Missä tämä tapahtuma tapahtui. Katso Metan toiminnon lähteen dokumentaatio.", + "business_messaging": "Yritysviestintä", + "email": "Sähköposti", + "phone_call": "Puhelinsoitto", + "chat": "Chat", + "physical_store": "Fyysinen myymälä", + "system_generated": "Järjestelmän luoma", + "other": "Muut" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Lisäasetukset" + }, + "testEvents": { + "title": "Testitapahtumat", + "description": "Liitä test_event_code kohteesta Events Manager → Test events. Kun se on asetettu, jokainen tämän kanavan tapahtuma ohjataan Test events -näkymään koko hyötykuormineen (arvo, valuutta, sisältötunnisteet) eikä sitä lasketa raportteihin. Poista se, kun olet valmis.", + "codeLabel": "Testitapahtuman koodi", + "codePlaceholder": "esim. TEST12345", + "save": "Tallenna koodi", + "clear": "Tyhjennä", + "saved": "Testitapahtuman koodi tallennettu.", + "cleared": "Testitapahtuman koodi tyhjennetty. Tapahtumat ovat taas live-tilassa.", + "send": "Lähetä testitapahtuma", + "sent": "Testitapahtuma lisätty jonoon. Se näkyy Test events -kohdassa Events Managerissa minuutin sisällä.", + "sendHint": "Lähettää yhden esimerkki-Purchase-tapahtuman (100 USD) tämän kanavan viimeisimmälle yhteystiedolle.", + "activeNotice": "Testitila on päällä: tämän kanavan tapahtumia ei lasketa raportteihin ennen kuin koodi poistetaan.", + "openTestEvents": "Avaa Test events" } }, "minigames": { diff --git a/apps/builder/messages/fr.json b/apps/builder/messages/fr.json index 729ed3672d..f6b813833c 100644 --- a/apps/builder/messages/fr.json +++ b/apps/builder/messages/fr.json @@ -2254,8 +2254,7 @@ "import": "Importer le flux", "export": "Exporter", "importStarted": "Le flux est en cours d'importation. Consultez l'historique des imports pour voir les résultats.", - "importJsonOnly": "Fichiers JSON uniquement", - "adsConversions": "Publicités et Meta Conversions" + "importJsonOnly": "Fichiers JSON uniquement" }, "splitTraffic": { "balanceHint": "La somme totale doit être égale à 100 %.", @@ -4406,11 +4405,6 @@ "description": "Connectez d'abord un compte de canal, puis revenez ici pour créer des publicités.", "cta": "Accéder aux paramètres du canal" }, - "movedNote": { - "title": "Les publicités ont été déplacées vers Outils", - "description": "Créez et gérez les publicités Click-to-Message depuis l'outil Publicités Click-to-Message.", - "cta": "Ouvrir Publicités Click-to-Message" - }, "dashboardCta": "Voir sur le tableau de bord Publicités" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Envoyez des événements LeadSubmitted depuis les conversations Messenger, Instagram et WhatsApp vers Meta.", + "description": "Envoyez des événements de conversion depuis les conversations Messenger, Instagram et WhatsApp vers Meta.", "datasetId": "ID de l’ensemble de données", "reconnect": "Reconnecter les autorisations", "connectViaFacebook": "Connecter via Facebook", "unsupportedExplanation": "Ce compte Instagram a été connecté avec Instagram Business Login. Connectez le compte via Facebook pour utiliser Meta Conversions API.", "flowStep": { - "description": "Mettez en file d’attente un événement LeadSubmitted pour Messenger, Instagram ou WhatsApp.", "whatsappNote": "Les événements WhatsApp ne sont envoyés que pour les conversations démarrées à partir d’une publicité click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Enregistrez un ID d’ensemble de données avant d’ajouter un jeton d’accès.", "invalidToken": "Ce jeton n’a pas pu accéder à l’ensemble de données.", "invalidDatasetId": "Saisissez un Dataset ID valide (chiffres uniquement).", - "whatsappNotFound": "Intégration WhatsApp introuvable." + "whatsappNotFound": "Intégration WhatsApp introuvable.", + "testEventCodeRequired": "Enregistrez un code d'événement de test avant d'envoyer un événement de test.", + "noContactForTest": "Aucun contact éligible sur ce canal pour l'instant. Un événement de test doit être attribué à un contact réel (pour WhatsApp, un contact issu d'une publicité click-to-WhatsApp).", + "invalidTestEventCode": "Le code d'événement de test ne peut contenir que des lettres, des chiffres, des tirets ou des tirets bas (64 caractères max)." }, "fields": { "eventType": { "label": "Type d’événement", - "leadSubmitted": "Prospect soumis" + "leadSubmitted": "Prospect soumis", + "purchase": "Achat", + "initiateCheckout": "Démarrage du paiement", + "addToCart": "Ajouter au panier", + "viewContent": "Consultation de contenu", + "orderCreated": "Commande créée", + "orderShipped": "Commande expédiée", + "orderDelivered": "Commande livrée", + "orderCanceled": "Commande annulée", + "orderReturned": "Commande retournée", + "cartAbandoned": "Panier abandonné", + "qualifiedLead": "Prospect qualifié", + "ratingProvided": "Note fournie", + "reviewProvided": "Avis fourni", + "addPaymentInfo": "Ajout d'informations de paiement", + "addToWishlist": "Ajouter à la liste de souhaits", + "completeRegistration": "Inscription terminée", + "contact": "Contact", + "customizeProduct": "Personnalisation du produit", + "donate": "Faire un don", + "findLocation": "Recherche d'emplacement", + "lead": "Prospect", + "schedule": "Prise de rendez-vous", + "search": "Recherche", + "startTrial": "Démarrer l'essai", + "submitApplication": "Envoi de candidature", + "subscribe": "S'abonner", + "custom": "Événement personnalisé…", + "groups": { + "commerce": "Commerce", + "leads": "Prospects", + "orders": "Commandes", + "feedback": "Avis", + "leadsAndSignups": "Prospects et inscriptions", + "other": "Autres" + } }, "value": "Valeur", "valuePlaceholder": "p. ex. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nom de l'événement personnalisé", + "customEventNamePlaceholder": "p. ex. MyCustomEvent", + "contentType": { + "label": "Type de contenu", + "product": "Produit", + "product_group": "Groupe de produits" + }, + "contentIds": "ID de contenu", + "contentIdsPlaceholder": "p. ex. 123,456" }, "datasetIdPlaceholder": "Collez l’ID de l’ensemble de données depuis Events Manager", "saveDataset": "Enregistrer", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Source de l'action", + "help": "Où cet événement a eu lieu. Consultez la documentation Meta sur la source de l'action.", + "business_messaging": "Messagerie professionnelle", + "email": "E-mail", + "phone_call": "Appel téléphonique", + "chat": "Chat", + "physical_store": "Magasin physique", + "system_generated": "Généré par le système", + "other": "Autres" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avancé" + }, + "testEvents": { + "title": "Événements de test", + "description": "Collez le test_event_code depuis Events Manager → Test events. Tant qu'il est défini, chaque événement de ce canal est acheminé vers la vue Test events avec sa charge utile complète (valeur, devise, ID de contenu) et n'est pas comptabilisé dans les rapports. Effacez-le une fois terminé.", + "codeLabel": "Code d'événement de test", + "codePlaceholder": "ex. TEST12345", + "save": "Enregistrer le code", + "clear": "Effacer", + "saved": "Code d'événement de test enregistré.", + "cleared": "Code d'événement de test effacé. Les événements sont de nouveau en direct.", + "send": "Envoyer un événement de test", + "sent": "Événement de test mis en file d'attente. Il apparaît sous Test events dans Events Manager en moins d'une minute.", + "sendHint": "Envoie un exemple de Purchase (100 USD) au contact le plus récent de ce canal.", + "activeNotice": "Le mode test est activé : les événements de ce canal ne sont pas comptabilisés dans les rapports tant que le code n'est pas effacé.", + "openTestEvents": "Ouvrir Test events" } }, "minigames": { diff --git a/apps/builder/messages/he.json b/apps/builder/messages/he.json index 2fc10243ce..51f4c1a969 100644 --- a/apps/builder/messages/he.json +++ b/apps/builder/messages/he.json @@ -418,8 +418,7 @@ "import": "ייבוא זרימה", "export": "ייצוא", "importStarted": "הזרימה בתהליך ייבוא. בדקו את היסטוריית הייבוא לתוצאות.", - "importJsonOnly": "קבצי JSON בלבד", - "adsConversions": "מודעות ו-Meta Conversions" + "importJsonOnly": "קבצי JSON בלבד" }, "splitTraffic": { "balanceHint": "הסכום הכולל חייב להיות 100%.", @@ -2570,11 +2569,6 @@ "description": "חברו תחילה חשבון ערוץ, ולאחר מכן חזרו לכאן כדי ליצור מודעות.", "cta": "מעבר להגדרות הערוץ" }, - "movedNote": { - "title": "המודעות עברו לכלים", - "description": "צרו ונהלו מודעות Click-to-Message מתוך כלי מודעות Click-to-Message.", - "cta": "פתיחת מודעות Click-to-Message" - }, "dashboardCta": "צפייה בלוח הבקרה של המודעות" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "שליחת אירועי LeadSubmitted משיחות Messenger, Instagram ו-WhatsApp אל Meta.", + "description": "שליחת אירועי המרה משיחות Messenger, Instagram ו-WhatsApp אל Meta.", "datasetId": "מזהה Dataset", "reconnect": "חיבור מחדש להרשאות", "connectViaFacebook": "חיבור דרך Facebook", "unsupportedExplanation": "חשבון Instagram זה חובר באמצעות Instagram Business Login. חברו את החשבון דרך Facebook כדי להשתמש ב-Meta Conversions API.", "flowStep": { - "description": "הוסיפו לתור אירוע LeadSubmitted עבור Messenger, Instagram או WhatsApp.", "whatsappNote": "אירועי WhatsApp נשלחים רק עבור שיחות שהתחילו ממודעת click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "שמרו מזהה Dataset לפני הוספת אסימון גישה.", "invalidToken": "האסימון הזה לא הצליח לגשת למאגר הנתונים.", "invalidDatasetId": "הזן Dataset ID תקין (ספרות בלבד).", - "whatsappNotFound": "שילוב WhatsApp לא נמצא." + "whatsappNotFound": "שילוב WhatsApp לא נמצא.", + "testEventCodeRequired": "שמור קוד אירוע בדיקה לפני שליחת אירוע בדיקה.", + "noContactForTest": "אין עדיין איש קשר מתאים בערוץ זה. אירוע בדיקה זקוק לאיש קשר אמיתי לשיוך (ב-WhatsApp, כזה שהגיע ממודעת click-to-WhatsApp).", + "invalidTestEventCode": "קוד אירוע הבדיקה יכול להכיל רק אותיות, ספרות, מקפים או קווים תחתונים (עד 64 תווים)." }, "fields": { "eventType": { "label": "סוג אירוע", - "leadSubmitted": "ליד נשלח" + "leadSubmitted": "ליד נשלח", + "purchase": "רכישה", + "initiateCheckout": "התחלת תשלום", + "addToCart": "הוספה לעגלה", + "viewContent": "צפייה בתוכן", + "orderCreated": "הזמנה נוצרה", + "orderShipped": "ההזמנה נשלחה", + "orderDelivered": "ההזמנה נמסרה", + "orderCanceled": "ההזמנה בוטלה", + "orderReturned": "ההזמנה הוחזרה", + "cartAbandoned": "עגלה ננטשה", + "qualifiedLead": "ליד מוסמך", + "ratingProvided": "דירוג ניתן", + "reviewProvided": "ביקורת ניתנה", + "addPaymentInfo": "הוספת פרטי תשלום", + "addToWishlist": "הוספה לרשימת המשאלות", + "completeRegistration": "השלמת הרשמה", + "contact": "יצירת קשר", + "customizeProduct": "התאמה אישית של מוצר", + "donate": "תרומה", + "findLocation": "איתור מיקום", + "lead": "ליד", + "schedule": "קביעת פגישה", + "search": "חיפוש", + "startTrial": "התחלת ניסיון", + "submitApplication": "הגשת בקשה", + "subscribe": "הרשמה למנוי", + "custom": "אירוע מותאם אישית…", + "groups": { + "commerce": "מסחר", + "leads": "לידים", + "orders": "הזמנות", + "feedback": "משוב", + "leadsAndSignups": "לידים והרשמות", + "other": "אחר" + } }, "value": "ערך", "valuePlaceholder": "לדוגמה: 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "שם האירוע המותאם אישית", + "customEventNamePlaceholder": "לדוגמה: MyCustomEvent", + "contentType": { + "label": "סוג תוכן", + "product": "מוצר", + "product_group": "קבוצת מוצרים" + }, + "contentIds": "מזהי תוכן", + "contentIdsPlaceholder": "לדוגמה: 123,456" }, "datasetIdPlaceholder": "הדביקו את מזהה ה-Dataset מ-Events Manager", "saveDataset": "שמור", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "מקור הפעולה", + "help": "היכן התרחש האירוע. עיינו בתיעוד של Meta בנושא מקור הפעולה.", + "business_messaging": "הודעות עסקיות", + "email": "אימייל", + "phone_call": "שיחת טלפון", + "chat": "צ'אט", + "physical_store": "חנות פיזית", + "system_generated": "נוצר על ידי המערכת", + "other": "אחר" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "מתקדם" + }, + "testEvents": { + "title": "אירועי בדיקה", + "description": "הדבק את test_event_code מתוך Events Manager ← Test events. כל עוד הוא מוגדר, כל אירוע מהערוץ הזה מנותב אל תצוגת Test events עם כל המטען שלו (ערך, מטבע, מזהי תוכן) ואינו נספר בדוחות. נקה אותו כשתסיים.", + "codeLabel": "קוד אירוע בדיקה", + "codePlaceholder": "למשל: TEST12345", + "save": "שמור קוד", + "clear": "נקה", + "saved": "קוד אירוע הבדיקה נשמר.", + "cleared": "קוד אירוע הבדיקה נוקה. האירועים חזרו להיות פעילים.", + "send": "שלח אירוע בדיקה", + "sent": "אירוע הבדיקה נכנס לתור. הוא יופיע תחת Test events ב-Events Manager תוך דקה.", + "sendHint": "שולח אירוע Purchase לדוגמה אחד (100 USD) לאיש הקשר האחרון בערוץ זה.", + "activeNotice": "מצב בדיקה פעיל: אירועים מהערוץ הזה לא נספרים בדוחות עד שהקוד ינוקה.", + "openTestEvents": "פתח את Test events" } }, "minigames": { diff --git a/apps/builder/messages/id.json b/apps/builder/messages/id.json index 4c9ad49149..dbc9b8e8d0 100644 --- a/apps/builder/messages/id.json +++ b/apps/builder/messages/id.json @@ -2254,8 +2254,7 @@ "import": "Impor Alur", "export": "Ekspor", "importStarted": "Alur sedang diimpor. Periksa riwayat impor untuk melihat hasilnya.", - "importJsonOnly": "Hanya file JSON", - "adsConversions": "Iklan & Meta Conversions" + "importJsonOnly": "Hanya file JSON" }, "splitTraffic": { "balanceHint": "Jumlah total harus sama dengan 100%.", @@ -4406,11 +4405,6 @@ "description": "Hubungkan akun channel terlebih dahulu, lalu kembali ke sini untuk membuat iklan.", "cta": "Buka pengaturan channel" }, - "movedNote": { - "title": "Iklan telah dipindahkan ke Alat", - "description": "Buat dan kelola iklan Click-to-Message dari alat Iklan Click-to-Message.", - "cta": "Buka Iklan Click-to-Message" - }, "dashboardCta": "Lihat di dasbor Iklan" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Kirim peristiwa LeadSubmitted dari percakapan Messenger, Instagram, dan WhatsApp ke Meta.", + "description": "Kirim peristiwa konversi dari percakapan Messenger, Instagram, dan WhatsApp ke Meta.", "datasetId": "Dataset ID", "reconnect": "Sambungkan ulang izin", "connectViaFacebook": "Hubungkan via Facebook", "unsupportedExplanation": "Akun Instagram ini terhubung menggunakan Instagram Business Login. Hubungkan akun melalui Facebook untuk menggunakan Meta Conversions API.", "flowStep": { - "description": "Antrekan peristiwa LeadSubmitted untuk Messenger, Instagram, atau WhatsApp.", "whatsappNote": "Peristiwa WhatsApp hanya dikirim untuk percakapan yang dimulai dari iklan click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Simpan Dataset ID sebelum menambahkan token akses.", "invalidToken": "Token ini tidak dapat mengakses dataset.", "invalidDatasetId": "Masukkan Dataset ID yang valid (hanya angka).", - "whatsappNotFound": "Integrasi WhatsApp tidak ditemukan." + "whatsappNotFound": "Integrasi WhatsApp tidak ditemukan.", + "testEventCodeRequired": "Simpan kode peristiwa uji sebelum mengirim peristiwa uji.", + "noContactForTest": "Belum ada kontak yang memenuhi syarat di saluran ini. Peristiwa uji memerlukan kontak nyata untuk dikaitkan (untuk WhatsApp, kontak yang berasal dari iklan click-to-WhatsApp).", + "invalidTestEventCode": "Kode peristiwa uji hanya boleh berisi huruf, angka, tanda hubung, atau garis bawah (maks. 64)." }, "fields": { "eventType": { "label": "Jenis peristiwa", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "Pembelian", + "initiateCheckout": "Mulai Checkout", + "addToCart": "Tambah ke Keranjang", + "viewContent": "Lihat Konten", + "orderCreated": "Pesanan Dibuat", + "orderShipped": "Pesanan Dikirim", + "orderDelivered": "Pesanan Terkirim", + "orderCanceled": "Pesanan Dibatalkan", + "orderReturned": "Pesanan Dikembalikan", + "cartAbandoned": "Keranjang Ditinggalkan", + "qualifiedLead": "Prospek Berkualitas", + "ratingProvided": "Penilaian Diberikan", + "reviewProvided": "Ulasan Diberikan", + "addPaymentInfo": "Tambah Info Pembayaran", + "addToWishlist": "Tambah ke Wishlist", + "completeRegistration": "Selesaikan Pendaftaran", + "contact": "Kontak", + "customizeProduct": "Kustomisasi Produk", + "donate": "Donasi", + "findLocation": "Cari Lokasi", + "lead": "Prospek", + "schedule": "Jadwalkan", + "search": "Pencarian", + "startTrial": "Mulai Uji Coba", + "submitApplication": "Kirim Aplikasi", + "subscribe": "Berlangganan", + "custom": "Peristiwa khusus…", + "groups": { + "commerce": "Perdagangan", + "leads": "Prospek", + "orders": "Pesanan", + "feedback": "Umpan Balik", + "leadsAndSignups": "Prospek & Pendaftaran", + "other": "Lainnya" + } }, "value": "Nilai", "valuePlaceholder": "misalnya 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nama peristiwa khusus", + "customEventNamePlaceholder": "mis. MyCustomEvent", + "contentType": { + "label": "Jenis konten", + "product": "Produk", + "product_group": "Grup Produk" + }, + "contentIds": "ID Konten", + "contentIdsPlaceholder": "mis. 123,456" }, "datasetIdPlaceholder": "Tempel Dataset ID dari Events Manager", "saveDataset": "Simpan", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Sumber tindakan", + "help": "Tempat peristiwa ini terjadi. Lihat dokumentasi sumber tindakan Meta.", + "business_messaging": "Pesan Bisnis", + "email": "Email", + "phone_call": "Panggilan Telepon", + "chat": "Obrolan", + "physical_store": "Toko Fisik", + "system_generated": "Dihasilkan Sistem", + "other": "Lainnya" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Lanjutan" + }, + "testEvents": { + "title": "Peristiwa uji", + "description": "Tempel test_event_code dari Events Manager → Test events. Selama diatur, setiap peristiwa dari saluran ini dialihkan ke tampilan Test events beserta payload lengkapnya (nilai, mata uang, ID konten) dan tidak dihitung dalam laporan. Hapus setelah selesai.", + "codeLabel": "Kode peristiwa uji", + "codePlaceholder": "mis. TEST12345", + "save": "Simpan kode", + "clear": "Hapus", + "saved": "Kode peristiwa uji tersimpan.", + "cleared": "Kode peristiwa uji dihapus. Peristiwa aktif kembali.", + "send": "Kirim peristiwa uji", + "sent": "Peristiwa uji masuk antrean. Peristiwa ini akan muncul di Test events pada Events Manager dalam waktu satu menit.", + "sendHint": "Mengirim satu contoh Purchase (100 USD) ke kontak terbaru pada saluran ini.", + "activeNotice": "Mode uji aktif: peristiwa dari saluran ini tidak dihitung dalam laporan sampai kode dihapus.", + "openTestEvents": "Buka Test events" } }, "minigames": { diff --git a/apps/builder/messages/it.json b/apps/builder/messages/it.json index c0adb66ea6..d8e117f31d 100644 --- a/apps/builder/messages/it.json +++ b/apps/builder/messages/it.json @@ -2254,8 +2254,7 @@ "import": "Importa flusso", "export": "Esporta", "importStarted": "Il flusso è in fase di importazione. Controlla la cronologia delle importazioni per i risultati.", - "importJsonOnly": "Solo file JSON", - "adsConversions": "Annunci e Meta Conversions" + "importJsonOnly": "Solo file JSON" }, "splitTraffic": { "balanceHint": "La somma totale deve essere pari al 100%.", @@ -4406,11 +4405,6 @@ "description": "Collega prima un account del canale, poi torna qui per creare annunci.", "cta": "Vai alle impostazioni del canale" }, - "movedNote": { - "title": "Gli annunci sono stati spostati in Strumenti", - "description": "Crea e gestisci gli annunci Click-to-Message dallo strumento Annunci Click-to-Message.", - "cta": "Apri Annunci Click-to-Message" - }, "dashboardCta": "Visualizza sulla dashboard Annunci" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Invia eventi LeadSubmitted dalle conversazioni di Messenger, Instagram e WhatsApp a Meta.", + "description": "Invia eventi di conversione dalle conversazioni di Messenger, Instagram e WhatsApp a Meta.", "datasetId": "ID dataset", "reconnect": "Riconnetti autorizzazioni", "connectViaFacebook": "Connetti tramite Facebook", "unsupportedExplanation": "Questo account Instagram è stato connesso con Instagram Business Login. Connetti l'account tramite Facebook per usare Meta Conversions API.", "flowStep": { - "description": "Accoda un evento LeadSubmitted per Messenger, Instagram o WhatsApp.", "whatsappNote": "Gli eventi WhatsApp vengono inviati solo per le conversazioni avviate da un annuncio click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Salva un ID dataset prima di aggiungere un token di accesso.", "invalidToken": "Questo token non è riuscito ad accedere al dataset.", "invalidDatasetId": "Inserisci un Dataset ID valido (solo numeri).", - "whatsappNotFound": "Integrazione WhatsApp non trovata." + "whatsappNotFound": "Integrazione WhatsApp non trovata.", + "testEventCodeRequired": "Salva un codice evento di test prima di inviare un evento di test.", + "noContactForTest": "Nessun contatto idoneo su questo canale. Un evento di test richiede un contatto reale a cui essere attribuito (per WhatsApp, uno proveniente da un annuncio click-to-WhatsApp).", + "invalidTestEventCode": "Il codice evento di test può contenere solo lettere, numeri, trattini o trattini bassi (max 64)." }, "fields": { "eventType": { "label": "Tipo di evento", - "leadSubmitted": "Lead inviato" + "leadSubmitted": "Lead inviato", + "purchase": "Acquisto", + "initiateCheckout": "Avvio del pagamento", + "addToCart": "Aggiungi al carrello", + "viewContent": "Visualizzazione contenuto", + "orderCreated": "Ordine creato", + "orderShipped": "Ordine spedito", + "orderDelivered": "Ordine consegnato", + "orderCanceled": "Ordine annullato", + "orderReturned": "Ordine reso", + "cartAbandoned": "Carrello abbandonato", + "qualifiedLead": "Lead qualificato", + "ratingProvided": "Valutazione fornita", + "reviewProvided": "Recensione fornita", + "addPaymentInfo": "Aggiungi info di pagamento", + "addToWishlist": "Aggiungi alla lista dei desideri", + "completeRegistration": "Registrazione completata", + "contact": "Contatto", + "customizeProduct": "Personalizzazione prodotto", + "donate": "Dona", + "findLocation": "Trova posizione", + "lead": "Lead", + "schedule": "Pianifica", + "search": "Ricerca", + "startTrial": "Avvia prova", + "submitApplication": "Invia candidatura", + "subscribe": "Iscriviti", + "custom": "Evento personalizzato…", + "groups": { + "commerce": "Commercio", + "leads": "Lead", + "orders": "Ordini", + "feedback": "Feedback", + "leadsAndSignups": "Lead e iscrizioni", + "other": "Altro" + } }, "value": "Valore", "valuePlaceholder": "es. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nome evento personalizzato", + "customEventNamePlaceholder": "es. MyCustomEvent", + "contentType": { + "label": "Tipo di contenuto", + "product": "Prodotto", + "product_group": "Gruppo di prodotti" + }, + "contentIds": "ID contenuto", + "contentIdsPlaceholder": "es. 123,456" }, "datasetIdPlaceholder": "Incolla l'ID dataset da Gestione eventi", "saveDataset": "Salva", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Origine dell'azione", + "help": "Dove si è verificato questo evento. Consulta la documentazione Meta sull'origine dell'azione.", + "business_messaging": "Messaggistica aziendale", + "email": "Email", + "phone_call": "Chiamata telefonica", + "chat": "Chat", + "physical_store": "Negozio fisico", + "system_generated": "Generato dal sistema", + "other": "Altro" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avanzate" + }, + "testEvents": { + "title": "Eventi di test", + "description": "Incolla il test_event_code da Events Manager → Test events. Finché è impostato, ogni evento di questo canale viene instradato alla vista Test events con il payload completo (valore, valuta, ID contenuto) e non viene conteggiato nei report. Cancellalo quando hai finito.", + "codeLabel": "Codice evento di test", + "codePlaceholder": "es. TEST12345", + "save": "Salva codice", + "clear": "Cancella", + "saved": "Codice evento di test salvato.", + "cleared": "Codice evento di test cancellato. Gli eventi sono di nuovo attivi.", + "send": "Invia evento di test", + "sent": "Evento di test in coda. Comparirà in Test events su Events Manager entro un minuto.", + "sendHint": "Invia un esempio di Purchase (100 USD) al contatto più recente di questo canale.", + "activeNotice": "La modalità test è attiva: gli eventi di questo canale non vengono conteggiati nei report finché il codice non viene cancellato.", + "openTestEvents": "Apri Test events" } }, "minigames": { diff --git a/apps/builder/messages/ja.json b/apps/builder/messages/ja.json index f0ba0f3c06..4b8a81fb2d 100644 --- a/apps/builder/messages/ja.json +++ b/apps/builder/messages/ja.json @@ -2254,8 +2254,7 @@ "import": "フローをインポート", "export": "エクスポート", "importStarted": "フローをインポート中です。結果はインポート履歴でご確認ください。", - "importJsonOnly": "JSONファイルのみ", - "adsConversions": "広告とMeta Conversions" + "importJsonOnly": "JSONファイルのみ" }, "splitTraffic": { "balanceHint": "合計は100%になる必要があります。", @@ -4385,11 +4384,6 @@ "description": "まずチャネルアカウントを接続してから、ここに戻って広告を作成してください。", "cta": "チャネル設定に移動" }, - "movedNote": { - "title": "広告はツールに移動しました", - "description": "Click-to-Message広告ツールからClick-to-Message広告を作成・管理できます。", - "cta": "Click-to-Message広告を開く" - }, "dashboardCta": "広告ダッシュボードで表示" }, "platformSettings": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Messenger、Instagram、WhatsApp の会話から LeadSubmitted イベントを Meta に送信します。", + "description": "Messenger、Instagram、WhatsApp の会話からコンバージョンイベントを Meta に送信します。", "datasetId": "データセットID", "reconnect": "権限を再連携", "connectViaFacebook": "Facebook 経由で連携", "unsupportedExplanation": "この Instagram アカウントは Instagram ビジネスログインで連携されています。Meta Conversions API を利用するには、Facebook 経由でアカウントを連携してください。", "flowStep": { - "description": "Messenger、Instagram、WhatsApp 向けに LeadSubmitted イベントをキューに追加します。", "whatsappNote": "WhatsApp のイベントは、Click-to-WhatsApp 広告から開始した会話でのみ送信されます。" }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "アクセストークンを追加する前にデータセットIDを保存してください。", "invalidToken": "このトークンではデータセットにアクセスできませんでした。", "invalidDatasetId": "有効なデータセットID(数字のみ)を入力してください。", - "whatsappNotFound": "WhatsApp の連携が見つかりません。" + "whatsappNotFound": "WhatsApp の連携が見つかりません。", + "testEventCodeRequired": "テストイベントを送信する前にテストイベントコードを保存してください。", + "noContactForTest": "このチャネルにはまだ対象となる連絡先がありません。テストイベントには紐付け先となる実際の連絡先が必要です(WhatsApp の場合は click-to-WhatsApp 広告経由の連絡先)。", + "invalidTestEventCode": "テストイベントコードには英字、数字、ハイフン、アンダースコアのみ使用できます(最大64文字)。" }, "fields": { "eventType": { "label": "イベントタイプ", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "購入", + "initiateCheckout": "購入手続き開始", + "addToCart": "カートに追加", + "viewContent": "コンテンツ閲覧", + "orderCreated": "注文作成", + "orderShipped": "注文発送", + "orderDelivered": "注文配達完了", + "orderCanceled": "注文キャンセル", + "orderReturned": "注文返品", + "cartAbandoned": "カート放棄", + "qualifiedLead": "有望見込み客", + "ratingProvided": "評価送信", + "reviewProvided": "レビュー送信", + "addPaymentInfo": "支払い情報追加", + "addToWishlist": "ウィッシュリストに追加", + "completeRegistration": "登録完了", + "contact": "お問い合わせ", + "customizeProduct": "商品カスタマイズ", + "donate": "寄付", + "findLocation": "店舗検索", + "lead": "見込み客", + "schedule": "予約", + "search": "検索", + "startTrial": "無料体験開始", + "submitApplication": "申し込み送信", + "subscribe": "登録", + "custom": "カスタムイベント…", + "groups": { + "commerce": "コマース", + "leads": "見込み客", + "orders": "注文", + "feedback": "フィードバック", + "leadsAndSignups": "見込み客と登録", + "other": "その他" + } }, "value": "値", "valuePlaceholder": "例: 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "カスタムイベント名", + "customEventNamePlaceholder": "例: MyCustomEvent", + "contentType": { + "label": "コンテンツタイプ", + "product": "商品", + "product_group": "商品グループ" + }, + "contentIds": "コンテンツID", + "contentIdsPlaceholder": "例: 123,456" }, "datasetIdPlaceholder": "Events Manager からデータセットIDを貼り付けてください", "saveDataset": "保存", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "アクションのソース", + "help": "このイベントが発生した場所です。Metaのアクションソースのドキュメントをご覧ください。", + "business_messaging": "ビジネスメッセージ", + "email": "メール", + "phone_call": "電話", + "chat": "チャット", + "physical_store": "実店舗", + "system_generated": "システム生成", + "other": "その他" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "詳細設定" + }, + "testEvents": { + "title": "テストイベント", + "description": "Events Manager → Test events から test_event_code を貼り付けます。設定されている間、このチャネルのすべてのイベントは完全なペイロード(値、通貨、コンテンツID)とともに Test events ビューに振り分けられ、レポートにはカウントされません。完了したらクリアしてください。", + "codeLabel": "テストイベントコード", + "codePlaceholder": "例: TEST12345", + "save": "コードを保存", + "clear": "クリア", + "saved": "テストイベントコードを保存しました。", + "cleared": "テストイベントコードをクリアしました。イベントは再びライブになります。", + "send": "テストイベントを送信", + "sent": "テストイベントをキューに追加しました。1分以内に Events Manager の Test events に表示されます。", + "sendHint": "このチャネルの最新の連絡先にサンプルの Purchase(100 USD)を1件送信します。", + "activeNotice": "テストモードが有効です。コードをクリアするまで、このチャネルのイベントはレポートにカウントされません。", + "openTestEvents": "Test events を開く" } }, "minigames": { diff --git a/apps/builder/messages/nl.json b/apps/builder/messages/nl.json index a8ff74ca97..1714d4107d 100644 --- a/apps/builder/messages/nl.json +++ b/apps/builder/messages/nl.json @@ -2254,8 +2254,7 @@ "import": "Flow importeren", "export": "Exporteren", "importStarted": "De flow wordt geïmporteerd. Bekijk de importgeschiedenis voor de resultaten.", - "importJsonOnly": "Alleen JSON-bestanden", - "adsConversions": "Advertenties en Meta Conversions" + "importJsonOnly": "Alleen JSON-bestanden" }, "splitTraffic": { "balanceHint": "De totale som moet gelijk zijn aan 100%.", @@ -4406,11 +4405,6 @@ "description": "Koppel eerst een kanaalaccount en kom daarna hier terug om advertenties te maken.", "cta": "Ga naar kanaalinstellingen" }, - "movedNote": { - "title": "Advertenties zijn verplaatst naar Hulpmiddelen", - "description": "Maak en beheer Click-to-Message-advertenties vanuit de tool Click-to-Message-advertenties.", - "cta": "Click-to-Message-advertenties openen" - }, "dashboardCta": "Bekijk in het advertentiedashboard" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Verstuur LeadSubmitted-gebeurtenissen vanuit Messenger-, Instagram- en WhatsApp-gesprekken naar Meta.", + "description": "Verstuur conversiegebeurtenissen vanuit Messenger-, Instagram- en WhatsApp-gesprekken naar Meta.", "datasetId": "Dataset-ID", "reconnect": "Machtigingen opnieuw koppelen", "connectViaFacebook": "Koppelen via Facebook", "unsupportedExplanation": "Dit Instagram-account is gekoppeld met Instagram Business Login. Koppel het account via Facebook om Meta Conversions API te kunnen gebruiken.", "flowStep": { - "description": "Plaats een LeadSubmitted-gebeurtenis in de wachtrij voor Messenger, Instagram of WhatsApp.", "whatsappNote": "WhatsApp-gebeurtenissen worden alleen verzonden voor gesprekken die zijn gestart vanuit een click-to-WhatsApp-advertentie." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Sla een Dataset-ID op voordat je een toegangstoken toevoegt.", "invalidToken": "Dit token kreeg geen toegang tot de dataset.", "invalidDatasetId": "Voer een geldig Dataset ID in (alleen cijfers).", - "whatsappNotFound": "WhatsApp-integratie niet gevonden." + "whatsappNotFound": "WhatsApp-integratie niet gevonden.", + "testEventCodeRequired": "Sla een testgebeurteniscode op voordat je een testgebeurtenis verzendt.", + "noContactForTest": "Nog geen geschikt contact op dit kanaal. Een testgebeurtenis heeft een echt contact nodig om aan toe te wijzen (voor WhatsApp een contact uit een click-to-WhatsApp-advertentie).", + "invalidTestEventCode": "De testgebeurteniscode mag alleen letters, cijfers, koppeltekens of underscores bevatten (max. 64)." }, "fields": { "eventType": { "label": "Gebeurtenistype", - "leadSubmitted": "Lead ingediend" + "leadSubmitted": "Lead ingediend", + "purchase": "Aankoop", + "initiateCheckout": "Afrekenen gestart", + "addToCart": "In winkelwagen", + "viewContent": "Inhoud bekijken", + "orderCreated": "Bestelling aangemaakt", + "orderShipped": "Bestelling verzonden", + "orderDelivered": "Bestelling afgeleverd", + "orderCanceled": "Bestelling geannuleerd", + "orderReturned": "Bestelling geretourneerd", + "cartAbandoned": "Winkelwagen verlaten", + "qualifiedLead": "Gekwalificeerde lead", + "ratingProvided": "Beoordeling gegeven", + "reviewProvided": "Recensie gegeven", + "addPaymentInfo": "Betaalgegevens toevoegen", + "addToWishlist": "Toevoegen aan verlanglijst", + "completeRegistration": "Registratie voltooid", + "contact": "Contact", + "customizeProduct": "Product aanpassen", + "donate": "Doneren", + "findLocation": "Locatie zoeken", + "lead": "Lead", + "schedule": "Afspraak plannen", + "search": "Zoeken", + "startTrial": "Proefperiode starten", + "submitApplication": "Aanvraag indienen", + "subscribe": "Abonneren", + "custom": "Aangepaste gebeurtenis…", + "groups": { + "commerce": "Commercie", + "leads": "Leads", + "orders": "Bestellingen", + "feedback": "Feedback", + "leadsAndSignups": "Leads & aanmeldingen", + "other": "Overig" + } }, "value": "Waarde", "valuePlaceholder": "bijv. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Naam van aangepaste gebeurtenis", + "customEventNamePlaceholder": "bijv. MyCustomEvent", + "contentType": { + "label": "Inhoudstype", + "product": "Product", + "product_group": "Productgroep" + }, + "contentIds": "Content-ID's", + "contentIdsPlaceholder": "bijv. 123,456" }, "datasetIdPlaceholder": "Plak de Dataset-ID uit Events Manager", "saveDataset": "Opslaan", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Actiebron", + "help": "Waar deze gebeurtenis plaatsvond. Zie de Meta-documentatie over actiebronnen.", + "business_messaging": "Zakelijke berichten", + "email": "E-mail", + "phone_call": "Telefoongesprek", + "chat": "Chat", + "physical_store": "Fysieke winkel", + "system_generated": "Door systeem gegenereerd", + "other": "Overig" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Geavanceerd" + }, + "testEvents": { + "title": "Testgebeurtenissen", + "description": "Plak de test_event_code uit Events Manager → Test events. Zolang deze is ingesteld, wordt elke gebeurtenis van dit kanaal naar de Test events-weergave geleid met de volledige payload (waarde, valuta, content-ID's) en niet meegeteld in rapporten. Wis de code wanneer je klaar bent.", + "codeLabel": "Testgebeurteniscode", + "codePlaceholder": "bijv. TEST12345", + "save": "Code opslaan", + "clear": "Wissen", + "saved": "Testgebeurteniscode opgeslagen.", + "cleared": "Testgebeurteniscode gewist. Gebeurtenissen zijn weer live.", + "send": "Testgebeurtenis verzenden", + "sent": "Testgebeurtenis in wachtrij geplaatst. Deze verschijnt binnen een minuut onder Test events in Events Manager.", + "sendHint": "Verstuurt één voorbeeld-Purchase (100 USD) naar het meest recente contact van dit kanaal.", + "activeNotice": "Testmodus staat aan: gebeurtenissen van dit kanaal worden pas weer meegeteld in rapporten zodra de code is gewist.", + "openTestEvents": "Test events openen" } }, "minigames": { diff --git a/apps/builder/messages/pt-BR.json b/apps/builder/messages/pt-BR.json index af7d43ecf3..21b58a3a92 100644 --- a/apps/builder/messages/pt-BR.json +++ b/apps/builder/messages/pt-BR.json @@ -2254,8 +2254,7 @@ "import": "Importar fluxo", "export": "Exportar", "importStarted": "O fluxo está sendo importado. Verifique o histórico de importações para ver os resultados.", - "importJsonOnly": "Somente arquivos JSON", - "adsConversions": "Anúncios e Meta Conversions" + "importJsonOnly": "Somente arquivos JSON" }, "splitTraffic": { "balanceHint": "A soma total deve ser igual a 100%.", @@ -4299,11 +4298,6 @@ "description": "Conecte uma conta do canal primeiro e depois volte aqui para criar anúncios.", "cta": "Ir para as configurações do canal" }, - "movedNote": { - "title": "Os anúncios foram movidos para Ferramentas", - "description": "Crie e gerencie os anúncios Click-to-Message na ferramenta Anúncios Click-to-Message.", - "cta": "Abrir Anúncios Click-to-Message" - }, "dashboardCta": "Ver no painel de Anúncios" }, "inboxTeams": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Envie eventos LeadSubmitted de conversas do Messenger, Instagram e WhatsApp para a Meta.", + "description": "Envie eventos de conversão de conversas do Messenger, Instagram e WhatsApp para a Meta.", "datasetId": "ID do conjunto de dados", "reconnect": "Reconectar permissões", "connectViaFacebook": "Conectar via Facebook", "unsupportedExplanation": "Esta conta do Instagram foi conectada com o Instagram Business Login. Conecte a conta via Facebook para usar a Meta Conversions API.", "flowStep": { - "description": "Enfileire um evento LeadSubmitted para Messenger, Instagram ou WhatsApp.", "whatsappNote": "Os eventos do WhatsApp são enviados apenas para conversas iniciadas a partir de um anúncio click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Salve um ID do conjunto de dados antes de adicionar um token de acesso.", "invalidToken": "Este token não conseguiu acessar o conjunto de dados.", "invalidDatasetId": "Insira um Dataset ID válido (apenas números).", - "whatsappNotFound": "Integração do WhatsApp não encontrada." + "whatsappNotFound": "Integração do WhatsApp não encontrada.", + "testEventCodeRequired": "Salve um código de evento de teste antes de enviar um evento de teste.", + "noContactForTest": "Ainda não há um contato elegível neste canal. Um evento de teste precisa de um contato real para atribuição (no WhatsApp, um que veio de um anúncio click-to-WhatsApp).", + "invalidTestEventCode": "O código do evento de teste só pode conter letras, números, hífens ou sublinhados (máx. 64)." }, "fields": { "eventType": { "label": "Tipo de evento", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "Compra", + "initiateCheckout": "Início do checkout", + "addToCart": "Adicionar ao carrinho", + "viewContent": "Visualizar conteúdo", + "orderCreated": "Pedido criado", + "orderShipped": "Pedido enviado", + "orderDelivered": "Pedido entregue", + "orderCanceled": "Pedido cancelado", + "orderReturned": "Pedido devolvido", + "cartAbandoned": "Carrinho abandonado", + "qualifiedLead": "Lead qualificado", + "ratingProvided": "Avaliação fornecida", + "reviewProvided": "Avaliação enviada", + "addPaymentInfo": "Adicionar informações de pagamento", + "addToWishlist": "Adicionar à lista de desejos", + "completeRegistration": "Cadastro concluído", + "contact": "Contato", + "customizeProduct": "Personalizar produto", + "donate": "Doar", + "findLocation": "Encontrar local", + "lead": "Lead", + "schedule": "Agendar", + "search": "Pesquisa", + "startTrial": "Iniciar teste", + "submitApplication": "Enviar inscrição", + "subscribe": "Assinar", + "custom": "Evento personalizado…", + "groups": { + "commerce": "Comércio", + "leads": "Leads", + "orders": "Pedidos", + "feedback": "Feedback", + "leadsAndSignups": "Leads e cadastros", + "other": "Outros" + } }, "value": "Valor", "valuePlaceholder": "por exemplo, 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nome do evento personalizado", + "customEventNamePlaceholder": "ex.: MyCustomEvent", + "contentType": { + "label": "Tipo de conteúdo", + "product": "Produto", + "product_group": "Grupo de produtos" + }, + "contentIds": "IDs de conteúdo", + "contentIdsPlaceholder": "ex.: 123,456" }, "datasetIdPlaceholder": "Cole o ID do conjunto de dados do Gerenciador de Eventos", "saveDataset": "Salvar", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Origem da ação", + "help": "Onde este evento ocorreu. Consulte a documentação da Meta sobre origem da ação.", + "business_messaging": "Mensagens comerciais", + "email": "E-mail", + "phone_call": "Ligação telefônica", + "chat": "Chat", + "physical_store": "Loja física", + "system_generated": "Gerado pelo sistema", + "other": "Outros" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avançado" + }, + "testEvents": { + "title": "Eventos de teste", + "description": "Cole o test_event_code do Events Manager → Test events. Enquanto estiver definido, todo evento deste canal é encaminhado para a visualização Test events com o payload completo (valor, moeda, IDs de conteúdo) e não é contado nos relatórios. Limpe-o quando terminar.", + "codeLabel": "Código do evento de teste", + "codePlaceholder": "ex.: TEST12345", + "save": "Salvar código", + "clear": "Limpar", + "saved": "Código do evento de teste salvo.", + "cleared": "Código do evento de teste limpo. Os eventos voltaram a ser ao vivo.", + "send": "Enviar evento de teste", + "sent": "Evento de teste na fila. Ele aparece em Test events no Events Manager em até um minuto.", + "sendHint": "Envia um exemplo de Purchase (100 USD) para o contato mais recente deste canal.", + "activeNotice": "O modo de teste está ativado: os eventos deste canal não são contados nos relatórios até que o código seja limpo.", + "openTestEvents": "Abrir Test events" } }, "minigames": { diff --git a/apps/builder/messages/pt-PT.json b/apps/builder/messages/pt-PT.json index 94dfa20647..2d5cb68c45 100644 --- a/apps/builder/messages/pt-PT.json +++ b/apps/builder/messages/pt-PT.json @@ -2254,8 +2254,7 @@ "import": "Importar fluxo", "export": "Exportar", "importStarted": "O fluxo está a ser importado. Consulte o histórico de importações para ver os resultados.", - "importJsonOnly": "Apenas ficheiros JSON", - "adsConversions": "Anúncios e Meta Conversions" + "importJsonOnly": "Apenas ficheiros JSON" }, "splitTraffic": { "balanceHint": "A soma total deve ser igual a 100%.", @@ -4402,11 +4401,6 @@ "description": "Ligue primeiro uma conta do canal e depois volte aqui para criar anúncios.", "cta": "Ir para as definições do canal" }, - "movedNote": { - "title": "Os anúncios foram movidos para Ferramentas", - "description": "Crie e faça a gestão dos anúncios Click-to-Message a partir da ferramenta Anúncios Click-to-Message.", - "cta": "Abrir Anúncios Click-to-Message" - }, "dashboardCta": "Ver no painel de Anúncios" }, "QRCode": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Envie eventos LeadSubmitted de conversas do Messenger, Instagram e WhatsApp para a Meta.", + "description": "Envie eventos de conversão de conversas do Messenger, Instagram e WhatsApp para a Meta.", "datasetId": "ID do conjunto de dados", "reconnect": "Ligar novamente as permissões", "connectViaFacebook": "Ligar através do Facebook", "unsupportedExplanation": "Esta conta do Instagram foi ligada com o Instagram Business Login. Ligue a conta através do Facebook para utilizar o Meta Conversions API.", "flowStep": { - "description": "Coloque na fila um evento LeadSubmitted para o Messenger, Instagram ou WhatsApp.", "whatsappNote": "Os eventos do WhatsApp só são enviados para conversas iniciadas a partir de um anúncio click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Guarde um ID do conjunto de dados antes de adicionar um token de acesso.", "invalidToken": "Este token não conseguiu aceder ao conjunto de dados.", "invalidDatasetId": "Introduza um Dataset ID válido (apenas números).", - "whatsappNotFound": "Integração do WhatsApp não encontrada." + "whatsappNotFound": "Integração do WhatsApp não encontrada.", + "testEventCodeRequired": "Guarde um código de evento de teste antes de enviar um evento de teste.", + "noContactForTest": "Ainda não existe um contacto elegível neste canal. Um evento de teste precisa de um contacto real para atribuição (no WhatsApp, um que veio de um anúncio click-to-WhatsApp).", + "invalidTestEventCode": "O código do evento de teste só pode conter letras, números, hífenes ou sublinhados (máx. 64)." }, "fields": { "eventType": { "label": "Tipo de evento", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "Compra", + "initiateCheckout": "Início do checkout", + "addToCart": "Adicionar ao carrinho", + "viewContent": "Visualizar conteúdo", + "orderCreated": "Encomenda criada", + "orderShipped": "Encomenda enviada", + "orderDelivered": "Encomenda entregue", + "orderCanceled": "Encomenda cancelada", + "orderReturned": "Encomenda devolvida", + "cartAbandoned": "Carrinho abandonado", + "qualifiedLead": "Lead qualificado", + "ratingProvided": "Avaliação fornecida", + "reviewProvided": "Avaliação enviada", + "addPaymentInfo": "Adicionar informações de pagamento", + "addToWishlist": "Adicionar à lista de desejos", + "completeRegistration": "Registo concluído", + "contact": "Contacto", + "customizeProduct": "Personalizar produto", + "donate": "Doar", + "findLocation": "Encontrar localização", + "lead": "Lead", + "schedule": "Agendar", + "search": "Pesquisa", + "startTrial": "Iniciar período experimental", + "submitApplication": "Submeter candidatura", + "subscribe": "Subscrever", + "custom": "Evento personalizado…", + "groups": { + "commerce": "Comércio", + "leads": "Leads", + "orders": "Encomendas", + "feedback": "Feedback", + "leadsAndSignups": "Leads e registos", + "other": "Outros" + } }, "value": "Valor", "valuePlaceholder": "por ex., 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Nome do evento personalizado", + "customEventNamePlaceholder": "ex.: MyCustomEvent", + "contentType": { + "label": "Tipo de conteúdo", + "product": "Produto", + "product_group": "Grupo de produtos" + }, + "contentIds": "IDs de conteúdo", + "contentIdsPlaceholder": "ex.: 123,456" }, "datasetIdPlaceholder": "Cole o ID do conjunto de dados do Gestor de Eventos", "saveDataset": "Guardar", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Origem da ação", + "help": "Onde este evento ocorreu. Consulte a documentação da Meta sobre a origem da ação.", + "business_messaging": "Mensagens empresariais", + "email": "E-mail", + "phone_call": "Chamada telefónica", + "chat": "Chat", + "physical_store": "Loja física", + "system_generated": "Gerado pelo sistema", + "other": "Outros" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avançado" + }, + "testEvents": { + "title": "Eventos de teste", + "description": "Cole o test_event_code do Events Manager → Test events. Enquanto estiver definido, todos os eventos deste canal são encaminhados para a vista Test events com o payload completo (valor, moeda, IDs de conteúdo) e não são contabilizados nos relatórios. Limpe-o quando terminar.", + "codeLabel": "Código do evento de teste", + "codePlaceholder": "ex.: TEST12345", + "save": "Guardar código", + "clear": "Limpar", + "saved": "Código do evento de teste guardado.", + "cleared": "Código do evento de teste limpo. Os eventos estão novamente ao vivo.", + "send": "Enviar evento de teste", + "sent": "Evento de teste em fila. Aparece em Test events no Events Manager dentro de um minuto.", + "sendHint": "Envia um exemplo de Purchase (100 USD) para o contacto mais recente deste canal.", + "activeNotice": "O modo de teste está ativo: os eventos deste canal não são contabilizados nos relatórios até o código ser limpo.", + "openTestEvents": "Abrir Test events" } }, "minigames": { diff --git a/apps/builder/messages/ro.json b/apps/builder/messages/ro.json index a1ce7302e1..d95fe67abc 100644 --- a/apps/builder/messages/ro.json +++ b/apps/builder/messages/ro.json @@ -137,8 +137,7 @@ "import": "Importă fluxul", "export": "Exportă", "importStarted": "Fluxul se importă. Verifică istoricul importurilor pentru rezultate.", - "importJsonOnly": "Doar fișiere JSON", - "adsConversions": "Reclame și Meta Conversions" + "importJsonOnly": "Doar fișiere JSON" }, "splitTraffic": { "balanceHint": "Suma totală trebuie să fie egală cu 100%.", @@ -4360,11 +4359,6 @@ "description": "Conectează mai întâi un cont de canal, apoi revino aici pentru a crea reclame.", "cta": "Mergi la setările canalului" }, - "movedNote": { - "title": "Reclamele s-au mutat în Instrumente", - "description": "Creează și gestionează reclamele Click-to-Message din instrumentul Reclame Click-to-Message.", - "cta": "Deschide Reclame Click-to-Message" - }, "dashboardCta": "Vezi în panoul de control Reclame" }, "helpItems": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Trimite evenimente LeadSubmitted din conversațiile Messenger, Instagram și WhatsApp către Meta.", + "description": "Trimite evenimente de conversie din conversațiile Messenger, Instagram și WhatsApp către Meta.", "datasetId": "ID set de date", "reconnect": "Reconectează permisiunile", "connectViaFacebook": "Conectează prin Facebook", "unsupportedExplanation": "Acest cont Instagram a fost conectat cu Instagram Business Login. Conectează contul prin Facebook pentru a folosi Meta Conversions API.", "flowStep": { - "description": "Pune în coadă un eveniment LeadSubmitted pentru Messenger, Instagram sau WhatsApp.", "whatsappNote": "Evenimentele WhatsApp sunt trimise doar pentru conversațiile care au început dintr-un anunț click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Salvează un ID set de date înainte de a adăuga un token de acces.", "invalidToken": "Acest token nu a putut accesa setul de date.", "invalidDatasetId": "Introdu un Dataset ID valid (doar cifre).", - "whatsappNotFound": "Integrarea WhatsApp nu a fost găsită." + "whatsappNotFound": "Integrarea WhatsApp nu a fost găsită.", + "testEventCodeRequired": "Salvează un cod de eveniment de test înainte de a trimite un eveniment de test.", + "noContactForTest": "Încă nu există un contact eligibil pe acest canal. Un eveniment de test are nevoie de un contact real căruia să i se atribuie (pentru WhatsApp, unul provenit dintr-o reclamă click-to-WhatsApp).", + "invalidTestEventCode": "Codul evenimentului de test poate conține doar litere, cifre, cratime sau underscore-uri (max. 64)." }, "fields": { "eventType": { "label": "Tip de eveniment", - "leadSubmitted": "Lead trimis" + "leadSubmitted": "Lead trimis", + "purchase": "Cumpărare", + "initiateCheckout": "Inițiere finalizare comandă", + "addToCart": "Adaugă în coș", + "viewContent": "Vizualizare conținut", + "orderCreated": "Comandă creată", + "orderShipped": "Comandă expediată", + "orderDelivered": "Comandă livrată", + "orderCanceled": "Comandă anulată", + "orderReturned": "Comandă returnată", + "cartAbandoned": "Coș abandonat", + "qualifiedLead": "Client potențial calificat", + "ratingProvided": "Evaluare furnizată", + "reviewProvided": "Recenzie furnizată", + "addPaymentInfo": "Adăugare informații de plată", + "addToWishlist": "Adăugare la lista de dorințe", + "completeRegistration": "Înregistrare finalizată", + "contact": "Contact", + "customizeProduct": "Personalizare produs", + "donate": "Donează", + "findLocation": "Găsire locație", + "lead": "Client potențial", + "schedule": "Programare", + "search": "Căutare", + "startTrial": "Începe perioada de probă", + "submitApplication": "Trimitere cerere", + "subscribe": "Abonare", + "custom": "Eveniment personalizat…", + "groups": { + "commerce": "Comerț", + "leads": "Clienți potențiali", + "orders": "Comenzi", + "feedback": "Feedback", + "leadsAndSignups": "Clienți potențiali și înregistrări", + "other": "Altele" + } }, "value": "Valoare", "valuePlaceholder": "de ex. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Numele evenimentului personalizat", + "customEventNamePlaceholder": "ex. MyCustomEvent", + "contentType": { + "label": "Tip de conținut", + "product": "Produs", + "product_group": "Grup de produse" + }, + "contentIds": "ID-uri de conținut", + "contentIdsPlaceholder": "ex. 123,456" }, "datasetIdPlaceholder": "Lipește ID-ul setului de date din Events Manager", "saveDataset": "Salvează", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Sursa acțiunii", + "help": "Unde a avut loc acest eveniment. Consultați documentația Meta despre sursa acțiunii.", + "business_messaging": "Mesagerie business", + "email": "E-mail", + "phone_call": "Apel telefonic", + "chat": "Chat", + "physical_store": "Magazin fizic", + "system_generated": "Generat de sistem", + "other": "Altele" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avansat" + }, + "testEvents": { + "title": "Evenimente de test", + "description": "Lipește test_event_code din Events Manager → Test events. Cât timp este setat, fiecare eveniment de pe acest canal este direcționat către vizualizarea Test events cu payload-ul complet (valoare, monedă, ID-uri de conținut) și nu este contorizat în rapoarte. Șterge-l când ai terminat.", + "codeLabel": "Cod eveniment de test", + "codePlaceholder": "ex. TEST12345", + "save": "Salvează codul", + "clear": "Șterge", + "saved": "Codul evenimentului de test a fost salvat.", + "cleared": "Codul evenimentului de test a fost șters. Evenimentele sunt din nou live.", + "send": "Trimite eveniment de test", + "sent": "Evenimentul de test a fost pus în coadă. Apare în Test events din Events Manager în decurs de un minut.", + "sendHint": "Trimite un exemplu de Purchase (100 USD) către cel mai recent contact de pe acest canal.", + "activeNotice": "Modul de test este activ: evenimentele de pe acest canal nu sunt contorizate în rapoarte până când codul este șters.", + "openTestEvents": "Deschide Test events" } }, "minigames": { diff --git a/apps/builder/messages/sv.json b/apps/builder/messages/sv.json index 3d51c27ad2..f51a2de143 100644 --- a/apps/builder/messages/sv.json +++ b/apps/builder/messages/sv.json @@ -1408,11 +1408,6 @@ "description": "Anslut ett kanalkonto först och kom sedan tillbaka hit för att skapa annonser.", "cta": "Gå till kanalinställningar" }, - "movedNote": { - "title": "Annonser har flyttats till Verktyg", - "description": "Skapa och hantera Click-to-Message-annonser från verktyget Click-to-Message-annonser.", - "cta": "Öppna Click-to-Message-annonser" - }, "dashboardCta": "Visa i annonspanelen" }, "fields": { @@ -2970,8 +2965,7 @@ "import": "Importera flöde", "export": "Exportera", "importStarted": "Flödet importeras. Kontrollera importhistoriken för resultat.", - "importJsonOnly": "Endast JSON-filer", - "adsConversions": "Annonser och Meta Conversions" + "importJsonOnly": "Endast JSON-filer" }, "sendCarousel": { "addSlide": "Lägg till kort", @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Skicka LeadSubmitted-händelser från Messenger-, Instagram- och WhatsApp-konversationer till Meta.", + "description": "Skicka konverteringshändelser från Messenger-, Instagram- och WhatsApp-konversationer till Meta.", "datasetId": "Dataset-ID", "reconnect": "Återanslut behörigheter", "connectViaFacebook": "Anslut via Facebook", "unsupportedExplanation": "Det här Instagram-kontot anslöts med Instagram Business Login. Anslut kontot via Facebook för att använda Meta Conversions API.", "flowStep": { - "description": "Köa en LeadSubmitted-händelse för Messenger, Instagram eller WhatsApp.", "whatsappNote": "WhatsApp-händelser skickas endast för konversationer som startade från en klicka-till-WhatsApp-annons." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Spara ett Dataset-ID innan du lägger till en åtkomsttoken.", "invalidToken": "Den här token kunde inte komma åt datasetet.", "invalidDatasetId": "Ange ett giltigt Dataset ID (endast siffror).", - "whatsappNotFound": "WhatsApp-integrationen hittades inte." + "whatsappNotFound": "WhatsApp-integrationen hittades inte.", + "testEventCodeRequired": "Spara en testhändelsekod innan du skickar en testhändelse.", + "noContactForTest": "Ingen lämplig kontakt på den här kanalen än. En testhändelse behöver en riktig kontakt att kopplas till (för WhatsApp en som kom från en click-to-WhatsApp-annons).", + "invalidTestEventCode": "Testhändelsekoden får bara innehålla bokstäver, siffror, bindestreck eller understreck (max 64)." }, "fields": { "eventType": { "label": "Händelsetyp", - "leadSubmitted": "Lead Submitted" + "leadSubmitted": "Lead Submitted", + "purchase": "Köp", + "initiateCheckout": "Påbörja kassan", + "addToCart": "Lägg i varukorgen", + "viewContent": "Visa innehåll", + "orderCreated": "Order skapad", + "orderShipped": "Order skickad", + "orderDelivered": "Order levererad", + "orderCanceled": "Order avbruten", + "orderReturned": "Order returnerad", + "cartAbandoned": "Övergiven varukorg", + "qualifiedLead": "Kvalificerad lead", + "ratingProvided": "Betyg angivet", + "reviewProvided": "Recension angiven", + "addPaymentInfo": "Lägg till betalningsinfo", + "addToWishlist": "Lägg till i önskelistan", + "completeRegistration": "Fullföljd registrering", + "contact": "Kontakt", + "customizeProduct": "Anpassa produkt", + "donate": "Donera", + "findLocation": "Hitta plats", + "lead": "Lead", + "schedule": "Boka tid", + "search": "Sökning", + "startTrial": "Starta provperiod", + "submitApplication": "Skicka ansökan", + "subscribe": "Prenumerera", + "custom": "Anpassad händelse…", + "groups": { + "commerce": "Handel", + "leads": "Leads", + "orders": "Ordrar", + "feedback": "Feedback", + "leadsAndSignups": "Leads och registreringar", + "other": "Övrigt" + } }, "value": "Värde", "valuePlaceholder": "t.ex. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Namn på anpassad händelse", + "customEventNamePlaceholder": "t.ex. MyCustomEvent", + "contentType": { + "label": "Innehållstyp", + "product": "Produkt", + "product_group": "Produktgrupp" + }, + "contentIds": "Innehålls-ID", + "contentIdsPlaceholder": "t.ex. 123,456" }, "datasetIdPlaceholder": "Klistra in Dataset-ID från Events Manager", "saveDataset": "Spara", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Åtgärdskälla", + "help": "Var denna händelse ägde rum. Se Metas dokumentation om åtgärdskälla.", + "business_messaging": "Företagsmeddelanden", + "email": "E-post", + "phone_call": "Telefonsamtal", + "chat": "Chatt", + "physical_store": "Fysisk butik", + "system_generated": "Systemgenererad", + "other": "Övrigt" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Avancerat" + }, + "testEvents": { + "title": "Testhändelser", + "description": "Klistra in test_event_code från Events Manager → Test events. Medan den är inställd dirigeras varje händelse från den här kanalen till vyn Test events med hela nyttolasten (värde, valuta, innehålls-ID) och räknas inte i rapporter. Rensa den när du är klar.", + "codeLabel": "Testhändelsekod", + "codePlaceholder": "t.ex. TEST12345", + "save": "Spara kod", + "clear": "Rensa", + "saved": "Testhändelsekod sparad.", + "cleared": "Testhändelsekod rensad. Händelser är live igen.", + "send": "Skicka testhändelse", + "sent": "Testhändelse i kö. Den visas under Test events i Events Manager inom en minut.", + "sendHint": "Skickar en exempel-Purchase (100 USD) till kanalens senaste kontakt.", + "activeNotice": "Testläge är på: händelser från den här kanalen räknas inte i rapporter förrän koden rensas.", + "openTestEvents": "Öppna Test events" } }, "minigames": { diff --git a/apps/builder/messages/tr.json b/apps/builder/messages/tr.json index 675c0ca1c4..231e67d267 100644 --- a/apps/builder/messages/tr.json +++ b/apps/builder/messages/tr.json @@ -2328,8 +2328,7 @@ "import": "Akışı içe aktar", "export": "Dışa aktar", "importStarted": "Akış içe aktarılıyor. Sonuçlar için içe aktarma geçmişini kontrol edin.", - "importJsonOnly": "Yalnızca JSON dosyaları", - "adsConversions": "Reklamlar ve Meta Conversions" + "importJsonOnly": "Yalnızca JSON dosyaları" }, "splitTraffic": { "balanceHint": "Toplam %100 olmalıdır.", @@ -4406,11 +4405,6 @@ "description": "Önce bir kanal hesabı bağlayın, ardından reklam oluşturmak için buraya geri dönün.", "cta": "Kanal ayarlarına git" }, - "movedNote": { - "title": "Reklamlar Araçlar'a taşındı", - "description": "Click-to-Message reklamlarını Click-to-Message Reklamları aracından oluşturun ve yönetin.", - "cta": "Click-to-Message Reklamları'nı aç" - }, "dashboardCta": "Reklamlar panosunda görüntüle" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Messenger, Instagram ve WhatsApp konuşmalarından LeadSubmitted etkinliklerini Meta'ya gönderin.", + "description": "Messenger, Instagram ve WhatsApp konuşmalarından dönüşüm etkinliklerini Meta'ya gönderin.", "datasetId": "Veri Kümesi ID", "reconnect": "İzinleri yeniden bağla", "connectViaFacebook": "Facebook üzerinden bağlan", "unsupportedExplanation": "Bu Instagram hesabı Instagram Business Girişi ile bağlandı. Meta Conversions API'yi kullanmak için hesabı Facebook üzerinden bağlayın.", "flowStep": { - "description": "Messenger, Instagram veya WhatsApp için bir LeadSubmitted etkinliği kuyruğa alın.", "whatsappNote": "WhatsApp etkinlikleri yalnızca click-to-WhatsApp reklamından başlayan konuşmalar için gönderilir." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Erişim jetonu eklemeden önce bir Veri Kümesi ID'si kaydedin.", "invalidToken": "Bu jeton veri kümesine erişemedi.", "invalidDatasetId": "Geçerli bir Dataset ID girin (yalnızca rakamlar).", - "whatsappNotFound": "WhatsApp entegrasyonu bulunamadı." + "whatsappNotFound": "WhatsApp entegrasyonu bulunamadı.", + "testEventCodeRequired": "Bir test etkinliği göndermeden önce test etkinliği kodunu kaydedin.", + "noContactForTest": "Bu kanalda henüz uygun bir kişi yok. Test etkinliği, ilişkilendirilecek gerçek bir kişi gerektirir (WhatsApp için click-to-WhatsApp reklamından gelen bir kişi).", + "invalidTestEventCode": "Test etkinliği kodu yalnızca harf, rakam, tire veya alt çizgi içerebilir (en fazla 64)." }, "fields": { "eventType": { "label": "Etkinlik Türü", - "leadSubmitted": "Potansiyel Müşteri Gönderildi" + "leadSubmitted": "Potansiyel Müşteri Gönderildi", + "purchase": "Satın Alma", + "initiateCheckout": "Ödemeyi Başlat", + "addToCart": "Sepete Ekle", + "viewContent": "İçeriği Görüntüle", + "orderCreated": "Sipariş Oluşturuldu", + "orderShipped": "Sipariş Kargoya Verildi", + "orderDelivered": "Sipariş Teslim Edildi", + "orderCanceled": "Sipariş İptal Edildi", + "orderReturned": "Sipariş İade Edildi", + "cartAbandoned": "Sepet Terk Edildi", + "qualifiedLead": "Nitelikli Potansiyel Müşteri", + "ratingProvided": "Değerlendirme Verildi", + "reviewProvided": "İnceleme Verildi", + "addPaymentInfo": "Ödeme Bilgisi Ekle", + "addToWishlist": "İstek Listesine Ekle", + "completeRegistration": "Kaydı Tamamla", + "contact": "İletişim", + "customizeProduct": "Ürünü Özelleştir", + "donate": "Bağış Yap", + "findLocation": "Konum Bul", + "lead": "Potansiyel Müşteri", + "schedule": "Randevu Al", + "search": "Arama", + "startTrial": "Denemeyi Başlat", + "submitApplication": "Başvuru Gönder", + "subscribe": "Abone Ol", + "custom": "Özel etkinlik…", + "groups": { + "commerce": "Ticaret", + "leads": "Potansiyel Müşteriler", + "orders": "Siparişler", + "feedback": "Geri Bildirim", + "leadsAndSignups": "Potansiyel Müşteriler ve Kayıtlar", + "other": "Diğer" + } }, "value": "Değer", "valuePlaceholder": "ör. 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Özel etkinlik adı", + "customEventNamePlaceholder": "örn. MyCustomEvent", + "contentType": { + "label": "İçerik türü", + "product": "Ürün", + "product_group": "Ürün Grubu" + }, + "contentIds": "İçerik Kimlikleri", + "contentIdsPlaceholder": "örn. 123,456" }, "datasetIdPlaceholder": "Etkinlik Yöneticisi'nden Veri Kümesi ID'sini yapıştırın", "saveDataset": "Kaydet", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Eylem kaynağı", + "help": "Bu etkinliğin nerede gerçekleştiği. Meta'nın eylem kaynağı belgelerine bakın.", + "business_messaging": "İşletme Mesajlaşması", + "email": "E-posta", + "phone_call": "Telefon Görüşmesi", + "chat": "Sohbet", + "physical_store": "Fiziksel Mağaza", + "system_generated": "Sistem Tarafından Oluşturuldu", + "other": "Diğer" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Gelişmiş" + }, + "testEvents": { + "title": "Test etkinlikleri", + "description": "Events Manager → Test events üzerinden test_event_code değerini yapıştırın. Ayarlı olduğu sürece bu kanaldaki her etkinlik, tam yüküyle (değer, para birimi, içerik kimlikleri) Test events görünümüne yönlendirilir ve raporlarda sayılmaz. İşiniz bitince temizleyin.", + "codeLabel": "Test etkinliği kodu", + "codePlaceholder": "örn. TEST12345", + "save": "Kodu kaydet", + "clear": "Temizle", + "saved": "Test etkinliği kodu kaydedildi.", + "cleared": "Test etkinliği kodu temizlendi. Etkinlikler tekrar canlı.", + "send": "Test etkinliği gönder", + "sent": "Test etkinliği sıraya alındı. Bir dakika içinde Events Manager içindeki Test events altında görünür.", + "sendHint": "Bu kanalın en son kişisine örnek bir Purchase (100 USD) gönderir.", + "activeNotice": "Test modu açık: kod temizlenene kadar bu kanaldaki etkinlikler raporlarda sayılmaz.", + "openTestEvents": "Test events'i aç" } }, "minigames": { diff --git a/apps/builder/messages/vi.json b/apps/builder/messages/vi.json index 4409389b49..bc2094790a 100644 --- a/apps/builder/messages/vi.json +++ b/apps/builder/messages/vi.json @@ -2328,8 +2328,7 @@ "import": "Nhập luồng", "export": "Xuất", "importStarted": "Luồng đang được nhập. Kiểm tra lịch sử nhập để xem kết quả.", - "importJsonOnly": "Chỉ tệp JSON", - "adsConversions": "Quảng cáo và Meta Conversions" + "importJsonOnly": "Chỉ tệp JSON" }, "splitTraffic": { "balanceHint": "Tổng phần trăm phải bằng 100%.", @@ -4445,11 +4444,6 @@ "description": "Hãy kết nối một tài khoản kênh trước, sau đó quay lại đây để tạo quảng cáo.", "cta": "Đi đến cài đặt kênh" }, - "movedNote": { - "title": "Quảng cáo đã chuyển sang Công cụ", - "description": "Tạo và quản lý quảng cáo Click-to-Message từ công cụ Quảng cáo Click-to-Message.", - "cta": "Mở Quảng cáo Click-to-Message" - }, "dashboardCta": "Xem trên bảng điều khiển Quảng cáo" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "Gửi sự kiện LeadSubmitted từ hội thoại Messenger, Instagram và WhatsApp đến Meta.", + "description": "Gửi các sự kiện chuyển đổi từ hội thoại Messenger, Instagram và WhatsApp đến Meta.", "datasetId": "ID dataset", "reconnect": "Kết nối lại quyền", "connectViaFacebook": "Kết nối qua Facebook", "unsupportedExplanation": "Tài khoản Instagram này được kết nối bằng Instagram Business Login. Hãy kết nối tài khoản qua Facebook để dùng Meta Conversions API.", "flowStep": { - "description": "Đưa sự kiện LeadSubmitted cho Messenger, Instagram hoặc WhatsApp vào hàng đợi.", "whatsappNote": "Sự kiện WhatsApp chỉ được gửi cho các hội thoại bắt đầu từ quảng cáo click-to-WhatsApp." }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "Hãy lưu Dataset ID trước khi thêm access token.", "invalidToken": "Token này không truy cập được dataset.", "invalidDatasetId": "Nhập Dataset ID hợp lệ (chỉ gồm chữ số).", - "whatsappNotFound": "Không tìm thấy tích hợp WhatsApp." + "whatsappNotFound": "Không tìm thấy tích hợp WhatsApp.", + "testEventCodeRequired": "Hãy lưu mã sự kiện thử trước khi gửi sự kiện thử.", + "noContactForTest": "Kênh này chưa có liên hệ phù hợp. Sự kiện thử cần một liên hệ thật để gán vào (với WhatsApp, liên hệ phải đến từ quảng cáo click-to-WhatsApp).", + "invalidTestEventCode": "Mã sự kiện thử chỉ được chứa chữ, số, gạch ngang hoặc gạch dưới (tối đa 64 ký tự)." }, "fields": { "eventType": { "label": "Loại sự kiện", - "leadSubmitted": "Gửi thông tin (Lead)" + "leadSubmitted": "Gửi thông tin (Lead)", + "purchase": "Mua hàng", + "initiateCheckout": "Bắt đầu thanh toán", + "addToCart": "Thêm vào giỏ hàng", + "viewContent": "Xem nội dung", + "orderCreated": "Đơn hàng được tạo", + "orderShipped": "Đơn hàng đã gửi", + "orderDelivered": "Đơn hàng đã giao", + "orderCanceled": "Đơn hàng đã huỷ", + "orderReturned": "Đơn hàng đã trả lại", + "cartAbandoned": "Bỏ giỏ hàng", + "qualifiedLead": "Lead hợp lệ", + "ratingProvided": "Đã đánh giá", + "reviewProvided": "Đã nhận xét", + "addPaymentInfo": "Thêm thông tin thanh toán", + "addToWishlist": "Thêm vào yêu thích", + "completeRegistration": "Hoàn tất đăng ký", + "contact": "Liên hệ", + "customizeProduct": "Tuỳ chỉnh sản phẩm", + "donate": "Quyên góp", + "findLocation": "Tìm địa điểm", + "lead": "Lead", + "schedule": "Đặt lịch", + "search": "Tìm kiếm", + "startTrial": "Bắt đầu dùng thử", + "submitApplication": "Gửi đơn đăng ký", + "subscribe": "Đăng ký", + "custom": "Sự kiện tuỳ chỉnh…", + "groups": { + "commerce": "Thương mại", + "leads": "Lead", + "orders": "Đơn hàng", + "feedback": "Phản hồi", + "leadsAndSignups": "Lead & Đăng ký", + "other": "Khác" + } }, "value": "Giá trị", "valuePlaceholder": "vd: 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "Tên sự kiện tuỳ chỉnh", + "customEventNamePlaceholder": "vd: MyCustomEvent", + "contentType": { + "label": "Loại nội dung", + "product": "Sản phẩm", + "product_group": "Nhóm sản phẩm" + }, + "contentIds": "Mã nội dung", + "contentIdsPlaceholder": "vd: 123,456" }, "datasetIdPlaceholder": "Dán Dataset ID từ Events Manager", "saveDataset": "Lưu", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "Nguồn hành động", + "help": "Sự kiện này diễn ra ở đâu. Xem tài liệu về nguồn hành động của Meta.", + "business_messaging": "Nhắn tin doanh nghiệp", + "email": "Email", + "phone_call": "Cuộc gọi", + "chat": "Trò chuyện", + "physical_store": "Cửa hàng thực tế", + "system_generated": "Do hệ thống tạo", + "other": "Khác" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "Nâng cao" + }, + "testEvents": { + "title": "Sự kiện thử", + "description": "Dán test_event_code lấy từ Events Manager → Test events. Khi đang đặt mã, mọi sự kiện của kênh này được đưa vào màn Test events kèm đầy đủ dữ liệu (giá trị, tiền tệ, mã nội dung) và không được tính vào báo cáo. Xoá mã khi kiểm tra xong.", + "codeLabel": "Mã sự kiện thử", + "codePlaceholder": "vd: TEST12345", + "save": "Lưu mã", + "clear": "Xoá", + "saved": "Đã lưu mã sự kiện thử.", + "cleared": "Đã xoá mã sự kiện thử. Sự kiện gửi thật trở lại.", + "send": "Gửi sự kiện thử", + "sent": "Đã xếp hàng sự kiện thử. Nó sẽ hiện trong Test events của Events Manager trong khoảng một phút.", + "sendHint": "Gửi một sự kiện Purchase mẫu (100 USD) tới liên hệ gần nhất của kênh này.", + "activeNotice": "Đang ở chế độ thử: sự kiện của kênh này không được tính vào báo cáo cho tới khi xoá mã.", + "openTestEvents": "Mở Test events" } }, "minigames": { diff --git a/apps/builder/messages/zh-CN.json b/apps/builder/messages/zh-CN.json index 0e900862da..68d718e5a6 100644 --- a/apps/builder/messages/zh-CN.json +++ b/apps/builder/messages/zh-CN.json @@ -1411,11 +1411,6 @@ "description": "请先连接一个渠道账户,然后返回此处创建广告。", "cta": "前往渠道设置" }, - "movedNote": { - "title": "广告已移至工具", - "description": "在 Click-to-Message广告工具 中创建和管理 Click-to-Message 广告。", - "cta": "打开Click-to-Message广告" - }, "dashboardCta": "在广告仪表盘中查看" }, "fields": { @@ -2973,8 +2968,7 @@ "import": "导入流程", "export": "导出", "importStarted": "流程正在导入中,请稍后查看导入记录以获取结果。", - "importJsonOnly": "仅限 JSON 文件", - "adsConversions": "广告与 Meta Conversions" + "importJsonOnly": "仅限 JSON 文件" }, "additionalSteps": "附加步骤", "aiAnalyzeImage": { @@ -5062,11 +5056,10 @@ }, "metaConversions": { "flowStep": { - "description": "为 Messenger、Instagram 或 WhatsApp 排队发送一个 LeadSubmitted 事件。", "whatsappNote": "WhatsApp 事件仅针对由点击 WhatsApp 广告发起的对话发送。" }, "title": "Conversions API", - "description": "将 Messenger、Instagram 和 WhatsApp 对话中的 LeadSubmitted 事件发送给 Meta。", + "description": "将 Messenger、Instagram 和 WhatsApp 对话中的转化事件发送给 Meta。", "datasetId": "数据集 ID", "reconnect": "重新连接权限", "connectViaFacebook": "通过 Facebook 连接", @@ -5095,12 +5088,50 @@ "datasetRequired": "请先保存数据集 ID,再添加访问令牌。", "invalidToken": "此令牌无法访问该数据集。", "invalidDatasetId": "请输入有效的 Dataset ID(仅数字)。", - "whatsappNotFound": "未找到 WhatsApp 集成。" + "whatsappNotFound": "未找到 WhatsApp 集成。", + "testEventCodeRequired": "发送测试事件前请先保存测试事件代码。", + "noContactForTest": "此渠道尚无符合条件的联系人。测试事件需要归因到真实联系人(WhatsApp 需为来自 click-to-WhatsApp 广告的联系人)。", + "invalidTestEventCode": "测试事件代码只能包含字母、数字、连字符或下划线(最多 64 个字符)。" }, "fields": { "eventType": { "label": "事件类型", - "leadSubmitted": "已提交潜在客户" + "leadSubmitted": "已提交潜在客户", + "purchase": "购买", + "initiateCheckout": "开始结账", + "addToCart": "加入购物车", + "viewContent": "查看内容", + "orderCreated": "订单已创建", + "orderShipped": "订单已发货", + "orderDelivered": "订单已送达", + "orderCanceled": "订单已取消", + "orderReturned": "订单已退货", + "cartAbandoned": "放弃购物车", + "qualifiedLead": "合格潜在客户", + "ratingProvided": "已提供评分", + "reviewProvided": "已提供评论", + "addPaymentInfo": "添加付款信息", + "addToWishlist": "加入心愿单", + "completeRegistration": "完成注册", + "contact": "联系", + "customizeProduct": "定制产品", + "donate": "捐赠", + "findLocation": "查找地点", + "lead": "潜在客户", + "schedule": "预约", + "search": "搜索", + "startTrial": "开始试用", + "submitApplication": "提交申请", + "subscribe": "订阅", + "custom": "自定义事件…", + "groups": { + "commerce": "商务", + "leads": "潜在客户", + "orders": "订单", + "feedback": "反馈", + "leadsAndSignups": "潜在客户与注册", + "other": "其他" + } }, "value": "价值", "valuePlaceholder": "例如 250", @@ -5118,7 +5149,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "自定义事件名称", + "customEventNamePlaceholder": "例如 MyCustomEvent", + "contentType": { + "label": "内容类型", + "product": "产品", + "product_group": "产品组" + }, + "contentIds": "内容 ID", + "contentIdsPlaceholder": "例如 123,456" }, "datasetIdPlaceholder": "粘贴来自事件管理工具的数据集 ID", "saveDataset": "保存", @@ -5169,6 +5209,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "操作来源", + "help": "此事件发生的位置。请参阅 Meta 的操作来源文档。", + "business_messaging": "商业消息", + "email": "电子邮件", + "phone_call": "电话", + "chat": "聊天", + "physical_store": "实体店", + "system_generated": "系统生成", + "other": "其他" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "高级" + }, + "testEvents": { + "title": "测试事件", + "description": "粘贴来自 Events Manager → Test events 的 test_event_code。设置期间,此渠道的每个事件都会连同完整数据(价值、货币、内容 ID)一起转到 Test events 视图,且不计入报告。完成后请清除它。", + "codeLabel": "测试事件代码", + "codePlaceholder": "例如:TEST12345", + "save": "保存代码", + "clear": "清除", + "saved": "测试事件代码已保存。", + "cleared": "测试事件代码已清除。事件恢复正常上报。", + "send": "发送测试事件", + "sent": "测试事件已加入队列,一分钟内会出现在 Events Manager 的 Test events 中。", + "sendHint": "向该渠道最近的联系人发送一个示例 Purchase 事件(100 USD)。", + "activeNotice": "测试模式已开启:在清除代码之前,该渠道的事件不计入报告。", + "openTestEvents": "打开 Test events" } }, "appointments": { diff --git a/apps/builder/messages/zh-TW.json b/apps/builder/messages/zh-TW.json index 90a0129a47..7ecd9c95f9 100644 --- a/apps/builder/messages/zh-TW.json +++ b/apps/builder/messages/zh-TW.json @@ -2488,8 +2488,7 @@ "import": "匯入流程", "export": "匯出", "importStarted": "流程匯入中,請稍後查看匯入紀錄以取得結果。", - "importJsonOnly": "僅限 JSON 檔案", - "adsConversions": "廣告與 Meta Conversions" + "importJsonOnly": "僅限 JSON 檔案" }, "splitTraffic": { "balanceHint": "總和必須等於 100%。", @@ -4439,11 +4438,6 @@ "description": "請先連接一個頻道帳號,然後回到這裡建立廣告。", "cta": "前往頻道設定" }, - "movedNote": { - "title": "廣告已移至工具", - "description": "在 Click-to-Message廣告工具 中建立和管理 Click-to-Message 廣告。", - "cta": "開啟Click-to-Message廣告" - }, "dashboardCta": "在廣告儀表板中檢視" }, "ecommerce": { @@ -5340,13 +5334,12 @@ }, "metaConversions": { "title": "Conversions API", - "description": "將 Messenger、Instagram 和 WhatsApp 對話中的 LeadSubmitted 事件傳送給 Meta。", + "description": "將 Messenger、Instagram 和 WhatsApp 對話中的轉換事件傳送給 Meta。", "datasetId": "資料集 ID", "reconnect": "重新連接權限", "connectViaFacebook": "透過 Facebook 連接", "unsupportedExplanation": "此 Instagram 帳戶是透過 Instagram Business Login 連接的。請透過 Facebook 連接該帳戶,以使用 Meta Conversions API。", "flowStep": { - "description": "為 Messenger、Instagram 或 WhatsApp 排入一筆 LeadSubmitted 事件。", "whatsappNote": "WhatsApp 事件僅會針對由點擊式 WhatsApp 廣告發起的對話傳送。" }, "status": { @@ -5373,12 +5366,50 @@ "datasetRequired": "請先儲存資料集 ID,再新增存取權杖。", "invalidToken": "此權杖無法存取該資料集。", "invalidDatasetId": "請輸入有效的 Dataset ID(僅數字)。", - "whatsappNotFound": "找不到 WhatsApp 整合。" + "whatsappNotFound": "找不到 WhatsApp 整合。", + "testEventCodeRequired": "傳送測試事件前,請先儲存測試事件代碼。", + "noContactForTest": "此渠道尚無符合條件的聯絡人。測試事件需要歸因到真實聯絡人(WhatsApp 需為來自 click-to-WhatsApp 廣告的聯絡人)。", + "invalidTestEventCode": "測試事件代碼只能包含字母、數字、連字號或底線(最多 64 個字元)。" }, "fields": { "eventType": { "label": "事件類型", - "leadSubmitted": "已提交名單" + "leadSubmitted": "已提交名單", + "purchase": "購買", + "initiateCheckout": "開始結帳", + "addToCart": "加入購物車", + "viewContent": "檢視內容", + "orderCreated": "訂單已建立", + "orderShipped": "訂單已出貨", + "orderDelivered": "訂單已送達", + "orderCanceled": "訂單已取消", + "orderReturned": "訂單已退貨", + "cartAbandoned": "放棄購物車", + "qualifiedLead": "合格潛在客戶", + "ratingProvided": "已提供評分", + "reviewProvided": "已提供評論", + "addPaymentInfo": "新增付款資訊", + "addToWishlist": "加入願望清單", + "completeRegistration": "完成註冊", + "contact": "聯絡", + "customizeProduct": "客製化商品", + "donate": "捐款", + "findLocation": "尋找地點", + "lead": "潛在客戶", + "schedule": "預約", + "search": "搜尋", + "startTrial": "開始試用", + "submitApplication": "提交申請", + "subscribe": "訂閱", + "custom": "自訂事件…", + "groups": { + "commerce": "商務", + "leads": "潛在客戶", + "orders": "訂單", + "feedback": "意見回饋", + "leadsAndSignups": "潛在客戶與註冊", + "other": "其他" + } }, "value": "價值", "valuePlaceholder": "例如 250", @@ -5396,7 +5427,16 @@ "id": "Product ID", "quantity": "Quantity", "itemPrice": "Item price" - } + }, + "customEventName": "自訂事件名稱", + "customEventNamePlaceholder": "例如 MyCustomEvent", + "contentType": { + "label": "內容類型", + "product": "產品", + "product_group": "產品群組" + }, + "contentIds": "內容 ID", + "contentIdsPlaceholder": "例如 123,456" }, "datasetIdPlaceholder": "貼上來自 Events Manager 的資料集 ID", "saveDataset": "儲存", @@ -5447,6 +5487,36 @@ "limitedDataUse": { "label": "Limited Data Use (US privacy)", "description": "Restrict Meta's use of event data for users in applicable US states. Meta auto-detects the user's location from this event; no location data is sent by ChatbotX." + }, + "actionSource": { + "label": "動作來源", + "help": "此事件發生的位置。請參閱 Meta 的動作來源文件。", + "business_messaging": "商業訊息", + "email": "電子郵件", + "phone_call": "電話", + "chat": "聊天", + "physical_store": "實體店", + "system_generated": "系統產生", + "other": "其他" + }, + "dialog": { + "title": "Meta CAPI", + "advanced": "進階" + }, + "testEvents": { + "title": "測試事件", + "description": "貼上來自 Events Manager → Test events 的 test_event_code。設定期間,此頻道的每個事件都會連同完整資料(價值、貨幣、內容 ID)一併導向 Test events 檢視畫面,且不會計入報表。完成後請清除。", + "codeLabel": "測試事件代碼", + "codePlaceholder": "例如:TEST12345", + "save": "儲存代碼", + "clear": "清除", + "saved": "測試事件代碼已儲存。", + "cleared": "測試事件代碼已清除。事件已恢復正常上報。", + "send": "傳送測試事件", + "sent": "測試事件已加入佇列,一分鐘內會出現在 Events Manager 的 Test events 中。", + "sendHint": "向此頻道最近的聯絡人傳送一個範例 Purchase 事件(100 USD)。", + "activeNotice": "測試模式已開啟:在清除代碼之前,此頻道的事件不會計入報表。", + "openTestEvents": "開啟 Test events" } }, "minigames": { diff --git a/apps/builder/src/app/space/[workspaceId]/(integrations)/whatsapps/[id]/ads/page.tsx b/apps/builder/src/app/space/[workspaceId]/(integrations)/whatsapps/[id]/ads/page.tsx index 56ffc249c4..236844e3cc 100644 --- a/apps/builder/src/app/space/[workspaceId]/(integrations)/whatsapps/[id]/ads/page.tsx +++ b/apps/builder/src/app/space/[workspaceId]/(integrations)/whatsapps/[id]/ads/page.tsx @@ -73,6 +73,7 @@ export default async function WhatsappAdsPage(props: { wabaId: resolved.wabaId, hasCapiScope: resolved.hasCapiScope, datasetId: resolved.datasetId, + capiTestEventCode: resolved.capiTestEventCode, }} oauthCallbackUrl={new URL( WHATSAPP_OAUTH_CALLBACK_PATH, diff --git a/apps/builder/src/app/space/[workspaceId]/instagrams/[id]/ads/page.tsx b/apps/builder/src/app/space/[workspaceId]/instagrams/[id]/ads/page.tsx index 855dfbeed6..de881accb1 100644 --- a/apps/builder/src/app/space/[workspaceId]/instagrams/[id]/ads/page.tsx +++ b/apps/builder/src/app/space/[workspaceId]/instagrams/[id]/ads/page.tsx @@ -71,6 +71,7 @@ export default async function InstagramAdsPage(props: { type: resolved.type, hasCapiScope: resolved.hasCapiScope, datasetId: resolved.datasetId, + capiTestEventCode: resolved.capiTestEventCode, }} /> ) diff --git a/apps/builder/src/app/space/[workspaceId]/messengers/[id]/ads/page.tsx b/apps/builder/src/app/space/[workspaceId]/messengers/[id]/ads/page.tsx index 76722c9d25..a3df177a50 100644 --- a/apps/builder/src/app/space/[workspaceId]/messengers/[id]/ads/page.tsx +++ b/apps/builder/src/app/space/[workspaceId]/messengers/[id]/ads/page.tsx @@ -67,6 +67,7 @@ export default async function MessengerAdsPage(props: { id: resolved.id, hasCapiScope: resolved.hasCapiScope, datasetId: resolved.datasetId, + capiTestEventCode: resolved.capiTestEventCode, }} /> ) diff --git a/apps/builder/src/features/ads-campaign/components/messaging-ads-moved-alert.tsx b/apps/builder/src/features/ads-campaign/components/messaging-ads-moved-alert.tsx deleted file mode 100644 index 30a3aa3720..0000000000 --- a/apps/builder/src/features/ads-campaign/components/messaging-ads-moved-alert.tsx +++ /dev/null @@ -1,53 +0,0 @@ -"use client" - -import type { MessagingAdChannel } from "@chatbotx.io/database/partials" -import { - Alert, - AlertDescription, - AlertTitle, -} from "@chatbotx.io/ui/components/ui/alert" -import { buttonVariants } from "@chatbotx.io/ui/components/ui/button" -import { MegaphoneIcon } from "lucide-react" -import Link from "next/link" -import { useTranslations } from "next-intl" -import { buildMessagingAdsToolPath } from "../lib/tool-path" - -/** - * Small alert on the old "Ads Optimization" tab (`messenger-capi-tab.tsx` / - * `instagram-capi-tab.tsx` / `whatsapp-capi-tab.tsx`) pointing at the box's - * new home — the standalone Click to Message Ads tool. `"use client"` - * because every one of those tabs is itself a client component, so this - * needs the client `useTranslations` hook rather than server-only - * `getTranslations`. - */ -export function MessagingAdsMovedAlert({ - workspaceId, - channel, - integrationId, -}: { - workspaceId: string - channel: MessagingAdChannel - integrationId: string -}) { - const t = useTranslations() - - return ( - - - {t("clickToMessageAds.movedNote.title")} - -

{t("clickToMessageAds.movedNote.description")}

- - {t("clickToMessageAds.movedNote.cta")} - -
-
- ) -} diff --git a/apps/builder/src/features/ads/lib/ads-date-key.ts b/apps/builder/src/features/ads/lib/ads-date-key.ts index 221ab1393a..4a09abe746 100644 --- a/apps/builder/src/features/ads/lib/ads-date-key.ts +++ b/apps/builder/src/features/ads/lib/ads-date-key.ts @@ -14,8 +14,7 @@ * `fromZonedTime`, and the ads-conversion repository's day-bucketing * (`AT TIME ZONE`) is parameterized on that same timezone. A viewer's picked * calendar day now queries the matching window regardless of their UTC - * offset. See `docs/plans/2026-08-27-ads-timezone-migration.md` for the - * completed migration record. + * offset. * * RESIDUAL SEAM (by design, not a bug): Meta Graph API's `insights` endpoint * interprets `since`/`until` date-keys in the AD ACCOUNT's own reporting diff --git a/apps/builder/src/features/flows/react-flow/nodes/perform-action/__tests__/menu.test.ts b/apps/builder/src/features/flows/react-flow/nodes/perform-action/__tests__/menu.test.ts index cb1e64c649..614a9facbf 100644 --- a/apps/builder/src/features/flows/react-flow/nodes/perform-action/__tests__/menu.test.ts +++ b/apps/builder/src/features/flows/react-flow/nodes/perform-action/__tests__/menu.test.ts @@ -19,20 +19,22 @@ describe("perform action SendGrid registration", () => { }) }) -describe("perform action ads conversions menu", () => { - test("groups sendMetaCapiEvent under the renamed Ads/Meta Conversions group", () => { - const adsConversions = performActionMenus(t).find( - (item) => item.label === "flows.actions.adsConversions", - ) +describe("perform action Meta CAPI menu", () => { + test("exposes sendMetaCapiEvent as a top-level entry, not inside a group", () => { + const menus = performActionMenus(t) - expect(adsConversions?.children?.map((child) => child.stepType)).toEqual([ - stepTypes.enum.sendMetaCapiEvent, - ]) - // The old `metaConversions` group label no longer exists — it was - // renamed, not duplicated alongside a new group. + expect(menus).toContainEqual( + expect.objectContaining({ + label: "flows.actions.sendMetaCapiEvent", + stepType: stepTypes.enum.sendMetaCapiEvent, + }), + ) expect( - performActionMenus(t).some( - (item) => item.label === "flows.actions.metaConversions", + menus.some((item) => + [ + "flows.actions.adsConversions", + "flows.actions.metaConversions", + ].includes(item.label), ), ).toBe(false) }) diff --git a/apps/builder/src/features/flows/react-flow/nodes/perform-action/menu.tsx b/apps/builder/src/features/flows/react-flow/nodes/perform-action/menu.tsx index aa7d3f57c3..a2c0f0f3dd 100644 --- a/apps/builder/src/features/flows/react-flow/nodes/perform-action/menu.tsx +++ b/apps/builder/src/features/flows/react-flow/nodes/perform-action/menu.tsx @@ -619,16 +619,9 @@ export const performActionMenus = (t: TranslationFn): MenuItem[] => [ ], }, { - label: t("flows.actions.adsConversions"), + label: t("flows.actions.sendMetaCapiEvent"), icon: MegaphoneIcon, - stepType: null, - children: [ - { - label: t("flows.actions.sendMetaCapiEvent"), - icon: MegaphoneIcon, - stepType: stepTypes.enum.sendMetaCapiEvent, - }, - ], + stepType: stepTypes.enum.sendMetaCapiEvent, }, { label: t("flows.actions.triggers"), diff --git a/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/__tests__/viewer.test.tsx b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/__tests__/viewer.test.tsx new file mode 100644 index 0000000000..68e96ed958 --- /dev/null +++ b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/__tests__/viewer.test.tsx @@ -0,0 +1,87 @@ +// @vitest-environment jsdom +import { + type SendMetaCapiEventSchema, + sendMetaCapiEventDefaultFn, +} from "@chatbotx.io/flow-config" +import { act } from "react" +import { createRoot, type Root } from "react-dom/client" +import { afterEach, beforeEach, describe, expect, test, vi } from "vitest" +import SendMetaCapiEventViewer from "../viewer" + +/** Echoes the key back so assertions never depend on translated copy. */ +vi.mock("next-intl", () => ({ + useTranslations: () => (key: string) => key, +})) + +vi.mock("@/components/base-handle", () => ({ + BaseHandle: ({ id }: { id?: string | null }) => ( + + ), +})) + +let container: HTMLDivElement +let root: Root + +beforeEach(() => { + ;( + globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean } + ).IS_REACT_ACT_ENVIRONMENT = true + container = document.createElement("div") + document.body.appendChild(container) + root = createRoot(container) +}) + +afterEach(() => { + act(() => { + root.unmount() + }) + container.remove() +}) + +const render = (ui: React.ReactElement) => { + act(() => { + root.render(ui) + }) +} + +describe("SendMetaCapiEventViewer", () => { + test("a legacy step with no actionSource renders without throwing and hides the action-source line", () => { + // Flow versions saved before `actionSource` existed carry no value for + // it at all, and the editor restores node data raw (no zod defaults) — + // this simulates that shape, the way a legacy step would actually arrive + // at runtime despite `SendMetaCapiEventSchema` requiring the field. + const { actionSource: _actionSource, ...legacyFields } = + sendMetaCapiEventDefaultFn() + const legacyData = legacyFields as SendMetaCapiEventSchema + + expect(() => + render(), + ).not.toThrow() + expect(container.textContent).not.toContain("metaConversions.actionSource") + }) + + test("a non-business_messaging step still shows its action-source label", () => { + render( + , + ) + + expect(container.textContent).toContain( + "metaConversions.actionSource.email", + ) + }) + + test("business_messaging hides the action-source line", () => { + render( + , + ) + + expect(container.textContent).not.toContain("metaConversions.actionSource") + }) +}) diff --git a/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/editor.tsx b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/editor.tsx index a8bb0ffff8..03735882a2 100644 --- a/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/editor.tsx +++ b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/editor.tsx @@ -2,7 +2,7 @@ import { MegaphoneIcon } from "lucide-react" import { useTranslations } from "next-intl" -import { CapiEventFields } from "@/features/meta-conversions/components/capi-event-fields" +import { MetaCapiEventDialog } from "@/features/meta-conversions/components/meta-capi-event-dialog" import { BaseStepEditor } from "../base/editor" type SendMetaCapiEventEditorProps = { @@ -19,15 +19,7 @@ export const SendMetaCapiEventEditor = ({ icon={MegaphoneIcon} title={t("flows.actions.sendMetaCapiEvent")} > -
-

- {t("metaConversions.flowStep.description")} -

-

- {t("metaConversions.flowStep.whatsappNote")} -

- -
+ ) } diff --git a/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/viewer.tsx b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/viewer.tsx index ac37ae3a2a..f139378cc4 100644 --- a/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/viewer.tsx +++ b/apps/builder/src/features/flows/react-flow/steps/send-meta-capi-event/viewer.tsx @@ -4,6 +4,7 @@ import type { SendMetaCapiEventSchema } from "@chatbotx.io/flow-config" import { Card, CardContent } from "@chatbotx.io/ui/components/ui/card" import { MegaphoneIcon } from "lucide-react" import { useTranslations } from "next-intl" +import { getMetaCapiEventSummaryLines } from "@/features/meta-conversions/lib/event-summary" import { BaseStateViewer } from "../../states/viewer" import { BaseStepViewer } from "../base/viewer" @@ -11,6 +12,7 @@ export default function SendMetaCapiEventViewer(props: { data: SendMetaCapiEventSchema }) { const t = useTranslations() + const summaryLines = getMetaCapiEventSummaryLines(props.data, t) return ( @@ -19,13 +21,14 @@ export default function SendMetaCapiEventViewer(props: { icon={MegaphoneIcon} title={t("flows.actions.sendMetaCapiEvent")} /> - {props.data.value ? ( -

- {props.data.eventName} - {" · "} - {props.data.value} - {props.data.currency ? ` ${props.data.currency}` : ""} -

+ {summaryLines.length > 0 ? ( +
+ {summaryLines.map((line) => ( + + {line} + + ))} +
) : null} {/* React Flow keeps each state's connector on physical Position.Right. */} diff --git a/apps/builder/src/features/integration-instagram/components/instagram-capi-tab.tsx b/apps/builder/src/features/integration-instagram/components/instagram-capi-tab.tsx index 4b322f1607..397715178c 100644 --- a/apps/builder/src/features/integration-instagram/components/instagram-capi-tab.tsx +++ b/apps/builder/src/features/integration-instagram/components/instagram-capi-tab.tsx @@ -13,9 +13,9 @@ import { import { cn } from "@chatbotx.io/ui/lib/utils" import Link from "next/link" import { useTranslations } from "next-intl" -import { MessagingAdsMovedAlert } from "@/features/ads-campaign/components/messaging-ads-moved-alert" import { CapiConnectedCard } from "@/features/meta-conversions/components/capi-connected-card" import { CapiMethodChooser } from "@/features/meta-conversions/components/capi-method-chooser" +import { CapiTestEventCard } from "@/features/meta-conversions/components/capi-test-event-card" import { type CapiConnectionState, getCapiConnectionState, @@ -34,7 +34,7 @@ import { setInstagramCapiDatasetAction } from "../actions/set-capi-dataset.actio type InstagramCapiTabProps = { integrationInstagram: Pick< IntegrationInstagramModel, - "id" | "type" | "hasCapiScope" | "datasetId" + "id" | "type" | "hasCapiScope" | "datasetId" | "capiTestEventCode" > hasManualCapiAccessToken: boolean capiDisconnected: boolean @@ -44,6 +44,7 @@ type InstagramCapiTabProps = { const statusDescriptionKey = { ready: "metaConversions.statusDescriptions.ready", notConnected: "metaConversions.statusDescriptions.notConnected", + missingPermission: "metaConversions.statusDescriptions.missingPermission", unverified: "metaConversions.statusDescriptions.unverified", unsupported: "metaConversions.statusDescriptions.unsupported", } as const satisfies Record @@ -52,10 +53,12 @@ function renderConnectionContent({ connectionState, integrationInstagram, workspaceId, + notice, }: { connectionState: CapiConnectionState integrationInstagram: InstagramCapiTabProps["integrationInstagram"] workspaceId: string + notice: string }) { if (connectionState === "disconnected") { return ( @@ -72,12 +75,26 @@ function renderConnectionContent({ ) } return ( - + <> + + {/* Sending needs the Meta scope or a manual token; while the scope is + still missing a test would only be skipped, so hide the card. */} + {connectionState === "awaitingScope" ? null : ( + + )} + ) } @@ -97,7 +114,8 @@ export function InstagramCapiTab({ hasDatasetId: Boolean(integrationInstagram.datasetId), }) const status = getCapiStatus({ - hasCapiScope: !capiDisconnected && integrationInstagram.hasCapiScope, + hasCapiScope: integrationInstagram.hasCapiScope, + capiDisconnected, hasManualCapiAccessToken, hasDatasetId: Boolean(integrationInstagram.datasetId), credentialAvailable, @@ -109,6 +127,7 @@ export function InstagramCapiTab({ connectionState, integrationInstagram, workspaceId, + notice: t("metaConversions.statusDescriptions.missingPermission"), }) return ( @@ -148,13 +167,6 @@ export function InstagramCapiTab({ )}
- {supported && ( - - )} ) } diff --git a/apps/builder/src/features/integration-messenger/components/messenger-capi-tab.tsx b/apps/builder/src/features/integration-messenger/components/messenger-capi-tab.tsx index bb0ce9eaf7..a1786f4c50 100644 --- a/apps/builder/src/features/integration-messenger/components/messenger-capi-tab.tsx +++ b/apps/builder/src/features/integration-messenger/components/messenger-capi-tab.tsx @@ -11,9 +11,9 @@ import { } from "@chatbotx.io/ui/components/ui/card" import { cn } from "@chatbotx.io/ui/lib/utils" import { useTranslations } from "next-intl" -import { MessagingAdsMovedAlert } from "@/features/ads-campaign/components/messaging-ads-moved-alert" import { CapiConnectedCard } from "@/features/meta-conversions/components/capi-connected-card" import { CapiMethodChooser } from "@/features/meta-conversions/components/capi-method-chooser" +import { CapiTestEventCard } from "@/features/meta-conversions/components/capi-test-event-card" import { type CapiConnectionState, getCapiConnectionState, @@ -32,7 +32,7 @@ import { setMessengerCapiDatasetAction } from "../actions/set-capi-dataset.actio type MessengerCapiTabProps = { integrationMessenger: Pick< IntegrationMessengerModel, - "id" | "hasCapiScope" | "datasetId" + "id" | "hasCapiScope" | "datasetId" | "capiTestEventCode" > hasManualCapiAccessToken: boolean capiDisconnected: boolean @@ -42,6 +42,7 @@ type MessengerCapiTabProps = { const statusDescriptionKey = { ready: "metaConversions.statusDescriptions.ready", notConnected: "metaConversions.statusDescriptions.notConnected", + missingPermission: "metaConversions.statusDescriptions.missingPermission", unverified: "metaConversions.statusDescriptions.unverified", unsupported: "metaConversions.statusDescriptions.unsupported", } as const satisfies Record @@ -50,10 +51,12 @@ function renderConnectionContent({ connectionState, integrationMessenger, workspaceId, + notice, }: { connectionState: CapiConnectionState integrationMessenger: MessengerCapiTabProps["integrationMessenger"] workspaceId: string + notice: string }) { if (connectionState === "disconnected") { return ( @@ -70,12 +73,26 @@ function renderConnectionContent({ ) } return ( - + <> + + {/* Sending needs the Meta scope or a manual token; while the scope is + still missing a test would only be skipped, so hide the card. */} + {connectionState === "awaitingScope" ? null : ( + + )} + ) } @@ -94,7 +111,8 @@ export function MessengerCapiTab({ hasDatasetId: Boolean(integrationMessenger.datasetId), }) const status = getCapiStatus({ - hasCapiScope: !capiDisconnected && integrationMessenger.hasCapiScope, + hasCapiScope: integrationMessenger.hasCapiScope, + capiDisconnected, hasManualCapiAccessToken, hasDatasetId: Boolean(integrationMessenger.datasetId), credentialAvailable, @@ -125,14 +143,10 @@ export function MessengerCapiTab({ connectionState, integrationMessenger, workspaceId, + notice: t("metaConversions.statusDescriptions.missingPermission"), })} - ) } diff --git a/apps/builder/src/features/integration-whatsapp/components/whatsapp-capi-tab.tsx b/apps/builder/src/features/integration-whatsapp/components/whatsapp-capi-tab.tsx index 5cefb28b2e..a3b0096465 100644 --- a/apps/builder/src/features/integration-whatsapp/components/whatsapp-capi-tab.tsx +++ b/apps/builder/src/features/integration-whatsapp/components/whatsapp-capi-tab.tsx @@ -12,9 +12,9 @@ import { } from "@chatbotx.io/ui/components/ui/card" import { cn } from "@chatbotx.io/ui/lib/utils" import { useTranslations } from "next-intl" -import { MessagingAdsMovedAlert } from "@/features/ads-campaign/components/messaging-ads-moved-alert" import { CapiConnectedCard } from "@/features/meta-conversions/components/capi-connected-card" import { CapiMethodChooser } from "@/features/meta-conversions/components/capi-method-chooser" +import { CapiTestEventCard } from "@/features/meta-conversions/components/capi-test-event-card" import { type CapiConnectionState, getCapiConnectionState, @@ -40,6 +40,7 @@ type WhatsappCapiTabProps = { | "wabaId" | "hasCapiScope" | "datasetId" + | "capiTestEventCode" > hasManualCapiAccessToken: boolean capiDisconnected: boolean @@ -51,6 +52,7 @@ type WhatsappCapiTabProps = { const statusDescriptionKey = { ready: "metaConversions.statusDescriptions.ready", notConnected: "metaConversions.statusDescriptions.notConnected", + missingPermission: "metaConversions.statusDescriptions.missingPermission", unverified: "metaConversions.statusDescriptions.unverified", unsupported: "metaConversions.statusDescriptions.unsupported", } as const satisfies Record @@ -59,10 +61,12 @@ function renderConnectionContent({ connectionState, integrationWhatsapp, workspaceId, + notice, }: { connectionState: CapiConnectionState integrationWhatsapp: WhatsappCapiTabProps["integrationWhatsapp"] workspaceId: string + notice: string }) { if (connectionState === "disconnected") { return ( @@ -80,12 +84,26 @@ function renderConnectionContent({ ) } return ( - + <> + + {/* Sending needs the Meta scope or a manual token; while the scope is + still missing a test would only be skipped, so hide the card. */} + {connectionState === "awaitingScope" ? null : ( + + )} + ) } @@ -106,7 +124,8 @@ export function WhatsappCapiTab({ hasDatasetId: Boolean(integrationWhatsapp.datasetId), }) const status = getCapiStatus({ - hasCapiScope: !capiDisconnected && integrationWhatsapp.hasCapiScope, + hasCapiScope: integrationWhatsapp.hasCapiScope, + capiDisconnected, hasManualCapiAccessToken, hasDatasetId: Boolean(integrationWhatsapp.datasetId), credentialAvailable, @@ -137,6 +156,7 @@ export function WhatsappCapiTab({ connectionState, integrationWhatsapp, workspaceId, + notice: t("metaConversions.statusDescriptions.missingPermission"), })}

{t("metaConversions.flowStep.whatsappNote")} @@ -149,11 +169,6 @@ export function WhatsappCapiTab({ whatsappCredentialPublic={whatsappCredentialPublic} workspaceId={workspaceId} /> - ) } diff --git a/apps/builder/src/features/meta-conversions/actions/save-capi-test-event-code.action.ts b/apps/builder/src/features/meta-conversions/actions/save-capi-test-event-code.action.ts new file mode 100644 index 0000000000..922100897a --- /dev/null +++ b/apps/builder/src/features/meta-conversions/actions/save-capi-test-event-code.action.ts @@ -0,0 +1,62 @@ +"use server" + +import { metaConversionsService } from "@chatbotx.io/business" +import { ChatbotXException } from "@chatbotx.io/business/errors" +import { metaCapiEventChannelSchema } from "@chatbotx.io/database/schema" +import { zodBigintAsString } from "@chatbotx.io/utils" +import { getTranslations } from "next-intl/server" +import { z } from "zod" +import { assertWorkspaceSuperAdmin } from "@/lib/auth/assert-workspace-super-admin" +import { workspaceActionClient } from "@/lib/safe-action" +import { + findCapiIntegration, + integrationNotFoundErrorKey, +} from "../lib/find-capi-integration" + +const inputSchema = z.object({ + channel: metaCapiEventChannelSchema, + // Empty string from a cleared input means "remove the code". + testEventCode: z + .string() + .trim() + .max(64) + .regex(/^[A-Za-z0-9_-]*$/) + .transform((value) => (value.length > 0 ? value : null)), +}) + +type Input = z.infer + +/** Set or clear the Events Manager test_event_code for one channel integration. */ +export const saveCapiTestEventCodeAction = workspaceActionClient + .inputSchema(inputSchema) + .bindArgsSchemas([zodBigintAsString(), zodBigintAsString()]) + .action( + async ({ + parsedInput, + bindArgsParsedInputs: [workspaceId, integrationId], + }: { + parsedInput: Input + bindArgsParsedInputs: readonly [string, string] + }) => { + const t = await getTranslations("metaConversions.errors") + await assertWorkspaceSuperAdmin(workspaceId) + + const integration = await findCapiIntegration(parsedInput.channel, { + id: integrationId, + workspaceId, + }) + if (!integration) { + throw new ChatbotXException( + t(integrationNotFoundErrorKey[parsedInput.channel]), + ) + } + + await metaConversionsService.saveCapiTestEventCode({ + channel: parsedInput.channel, + integration, + testEventCode: parsedInput.testEventCode, + }) + + return { success: true, testEventCode: parsedInput.testEventCode } + }, + ) diff --git a/apps/builder/src/features/meta-conversions/actions/send-capi-test-event.action.ts b/apps/builder/src/features/meta-conversions/actions/send-capi-test-event.action.ts new file mode 100644 index 0000000000..2ece29f5a4 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/actions/send-capi-test-event.action.ts @@ -0,0 +1,66 @@ +"use server" + +import { + CapiTestEventError, + metaConversionsService, +} from "@chatbotx.io/business" +import { ChatbotXException } from "@chatbotx.io/business/errors" +import { metaCapiEventChannelSchema } from "@chatbotx.io/database/schema" +import { zodBigintAsString } from "@chatbotx.io/utils" +import { getTranslations } from "next-intl/server" +import { z } from "zod" +import { assertWorkspaceSuperAdmin } from "@/lib/auth/assert-workspace-super-admin" +import { workspaceActionClient } from "@/lib/safe-action" +import { + findCapiIntegration, + integrationNotFoundErrorKey, +} from "../lib/find-capi-integration" +import { surfaceCapiError } from "../lib/surface-capi-error" + +const inputSchema = z.object({ channel: metaCapiEventChannelSchema }) + +type Input = z.infer + +/** + * Queues one sample event through the real CAPI pipeline so the user can see + * the full payload under Events Manager → Test events. Requires a saved + * test_event_code (enforced by the business layer and again by the worker). + */ +export const sendCapiTestEventAction = workspaceActionClient + .inputSchema(inputSchema) + .bindArgsSchemas([zodBigintAsString(), zodBigintAsString()]) + .action( + async ({ + parsedInput, + bindArgsParsedInputs: [workspaceId, integrationId], + }: { + parsedInput: Input + bindArgsParsedInputs: readonly [string, string] + }) => { + const t = await getTranslations("metaConversions.errors") + await assertWorkspaceSuperAdmin(workspaceId) + + const integration = await findCapiIntegration(parsedInput.channel, { + id: integrationId, + workspaceId, + }) + if (!integration) { + throw new ChatbotXException( + t(integrationNotFoundErrorKey[parsedInput.channel]), + ) + } + + try { + const event = await metaConversionsService.enqueueTestEvent({ + channel: parsedInput.channel, + integration, + }) + return { success: true, queued: event !== null } + } catch (error) { + if (error instanceof CapiTestEventError) { + throw new ChatbotXException(t(error.reason)) + } + surfaceCapiError(error) + } + }, + ) diff --git a/apps/builder/src/features/meta-conversions/components/capi-connected-card.tsx b/apps/builder/src/features/meta-conversions/components/capi-connected-card.tsx index e76b6fd992..7bb077b32b 100644 --- a/apps/builder/src/features/meta-conversions/components/capi-connected-card.tsx +++ b/apps/builder/src/features/meta-conversions/components/capi-connected-card.tsx @@ -1,7 +1,12 @@ "use client" import { Button } from "@chatbotx.io/ui/components/ui/button" -import { ExternalLinkIcon, Loader2Icon, UnplugIcon } from "lucide-react" +import { + ExternalLinkIcon, + Loader2Icon, + TriangleAlertIcon, + UnplugIcon, +} from "lucide-react" import Link from "next/link" import { useRouter } from "next/navigation" import { useTranslations } from "next-intl" @@ -16,6 +21,10 @@ type CapiConnectedCardProps = { // Messenger/Instagram/WhatsApp disconnect actions share one signature; the // Messenger action type stands in as the shared contract for every tab. disconnectAction: typeof disconnectMessengerCapiAction + // Amber warning line shown between the dataset id and the buttons, e.g. + // when the dataset is saved but the Meta scope needed to send events is + // missing (awaitingScope). + notice?: string } export function CapiConnectedCard({ @@ -23,6 +32,7 @@ export function CapiConnectedCard({ integrationId, datasetId, disconnectAction, + notice, }: CapiConnectedCardProps) { const t = useTranslations() const router = useRouter() @@ -50,6 +60,12 @@ export function CapiConnectedCard({ + {notice ? ( +

+ + {notice} +

+ ) : null}
+ {testEventCode ? ( + + ) : null} +
+ + + {testEventCode ? ( +

+ {t("testEvents.activeNotice")} +

+ ) : null} + +
+ + {datasetId ? ( + + ) : null} +
+

+ {t("testEvents.sendHint")} +

+ + ) +} diff --git a/apps/builder/src/features/meta-conversions/components/capi-value-currency-fields.tsx b/apps/builder/src/features/meta-conversions/components/capi-value-currency-fields.tsx deleted file mode 100644 index 2e3171a7fa..0000000000 --- a/apps/builder/src/features/meta-conversions/components/capi-value-currency-fields.tsx +++ /dev/null @@ -1,37 +0,0 @@ -"use client" - -import { InputField } from "@chatbotx.io/ui/components/form/input-field" -import { useTranslations } from "next-intl" - -type CapiValueCurrencyFieldsProps = { - parentName: string -} - -/** - * Value/currency `InputField` pair used by `CapiEventFields` - * (`capi-event-fields.tsx`) to let a user set a STATIC CAPI value/currency - * on an event. - */ -export const CapiValueCurrencyFields = ({ - parentName, -}: CapiValueCurrencyFieldsProps) => { - const t = useTranslations() - - return ( - <> - - - - ) -} diff --git a/apps/builder/src/features/meta-conversions/components/meta-capi-event-dialog.tsx b/apps/builder/src/features/meta-conversions/components/meta-capi-event-dialog.tsx new file mode 100644 index 0000000000..abdd0bf4a6 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/components/meta-capi-event-dialog.tsx @@ -0,0 +1,144 @@ +"use client" + +import { + type MetaCapiEventFieldsSchema, + metaCapiEventFieldsSchema, + withMetaCapiEventRefinements, +} from "@chatbotx.io/flow-config" +import { Button } from "@chatbotx.io/ui/components/ui/button" +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@chatbotx.io/ui/components/ui/dialog" +import { Form } from "@chatbotx.io/ui/components/ui/form" +import { zodResolver } from "@hookform/resolvers/zod" +import { useTranslations } from "next-intl" +import { useState } from "react" +import { useForm, useFormContext, useWatch } from "react-hook-form" +import { getMetaCapiEventSummaryLines } from "../lib/event-summary" +import { MetaCapiEventFields } from "./meta-capi-event-fields" + +type MetaCapiEventDialogProps = { + parentName: string +} + +// Same rules as every other host of these fields, so the dialog can never +// confirm a value the step schema would go on to reject. +const eventDialogResolver = zodResolver( + withMetaCapiEventRefinements(metaCapiEventFieldsSchema), +) + +/** + * Botcake-style dialog around `MetaCapiEventFields` — an in-node summary plus + * an Edit button that opens a child form seeded from the parent form's + * current value. Confirm copies the child form back into the + * parent at `parentName`; Cancel discards the child form entirely. + */ +export const MetaCapiEventDialog = ({ + parentName, +}: MetaCapiEventDialogProps) => { + const t = useTranslations() + const [open, setOpen] = useState(false) + const [openCount, setOpenCount] = useState(0) + + const { + control: parentControl, + getValues: getParentValues, + setValue: setParentValue, + } = useFormContext() + + const parentValue: MetaCapiEventFieldsSchema = useWatch({ + control: parentControl, + name: parentName, + }) + + const form = useForm({ + resolver: eventDialogResolver, + defaultValues: getParentValues(parentName), + }) + + // Reset the child form from the parent's current value BEFORE flipping + // `open` to true, and bump `openCount` so the fields body below + // remounts under a fresh `key` — `useForm`'s `defaultValues` are only + // applied on mount, and `PlainTextEditorField` snapshots `getValues` once + // in its own mount effect, so neither would see a reset that happened + // only via `form.reset` without a remount, and Base UI keeps the dialog + // portal mounted through its close transition, so a rapid close→reopen + // needs the remount rather than relying on the dialog itself unmounting. + const handleOpenChange = (next: boolean) => { + if (next) { + form.reset(getParentValues(parentName)) + setOpenCount((count) => count + 1) + } + setOpen(next) + } + + const handleSubmit = form.handleSubmit((values) => { + setParentValue(parentName, { ...getParentValues(parentName), ...values }) + setOpen(false) + }) + + const summaryLines = getMetaCapiEventSummaryLines(parentValue, t) + + return ( + +
+ {summaryLines.length > 0 ? ( +
+ {summaryLines.map((line) => ( + + {line} + + ))} +
+ ) : null} +
+ + {t("actions.edit")} + + } + /> +
+
+ + + {t("metaConversions.dialog.title")} + + + +
+ +
+ +
+ + + + {t("actions.cancel")} + + } + /> + + +
+ +
+
+ ) +} diff --git a/apps/builder/src/features/meta-conversions/components/meta-capi-event-fields.tsx b/apps/builder/src/features/meta-conversions/components/meta-capi-event-fields.tsx new file mode 100644 index 0000000000..beb96dfa22 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/components/meta-capi-event-fields.tsx @@ -0,0 +1,266 @@ +"use client" + +import { ComboboxField } from "@chatbotx.io/ui/components/form/combobox-field" +import { InputField } from "@chatbotx.io/ui/components/form/input-field" +import { SelectField } from "@chatbotx.io/ui/components/form/select-field" +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@chatbotx.io/ui/components/ui/collapsible" +import { + defaultEventNameByCatalog, + eventNamesByCatalog, + metaCapiActionSourcePolicy, + metaCapiActionSourceValues, + metaCapiContentTypeValues, +} from "@chatbotx.io/utils/meta-capi" +import { ChevronDownIcon } from "lucide-react" +import { useTranslations } from "next-intl" +import { useEffect, useMemo } from "react" +import { useFormContext, useWatch } from "react-hook-form" +import { PlainTextEditorField } from "@/components/tiptap/plain-text-editor-field" +import { + buildEventOptions, + CUSTOM_EVENT_OPTION, + isEventNameAllowedForActionSource, +} from "../lib/event-catalog-options" +import { + getMetaCapiActionSourceLabel, + getMetaCapiContentTypeLabel, + META_CAPI_ACTION_SOURCE_DOCS_URL, +} from "../lib/event-label" +import { resolveMetaCapiActionSource } from "../lib/resolve-action-source" + +type MetaCapiEventFieldsProps = { + parentName: string +} + +/** + * Shared field set for the flow-step dialog (`MetaCapiEventDialog`) and the + * trigger action editor — one body, two hosts. The event catalog (and + * whether a custom name is offered) is driven entirely by `actionSource` + * via `metaCapiActionSourcePolicy`; changing the action source re-validates + * the current event name and resets it to the new catalog's default when it + * is no longer allowed. + */ +export const MetaCapiEventFields = ({ + parentName, +}: MetaCapiEventFieldsProps) => { + const t = useTranslations() + const { control, setValue, getValues } = useFormContext() + + // The dialog's child form uses this field set at its root (`parentName === + // ""`); the trigger action editor nests it under the action's own path. + // Support both without a leading-dot field-path bug. + const fieldName = (suffix: string) => + parentName ? `${parentName}.${suffix}` : suffix + + // Flow versions saved before `actionSource`/`eventName` existed on this + // step/action carry no value for them at all, and the dialog restores the + // parent's raw value into this form (no zod defaults applied) — so a + // legacy step would otherwise open with a blank action-source select and + // no default event selected. Back-fill both once, on mount only, so the + // dialog opens pre-selected the way a brand-new step would. + // biome-ignore lint/correctness/useExhaustiveDependencies: run once on mount only, to back-fill legacy values without clobbering later edits + useEffect(() => { + const storedActionSource = resolveMetaCapiActionSource( + getValues(fieldName("actionSource")), + ) + if (getValues(fieldName("actionSource")) === undefined) { + setValue(fieldName("actionSource"), storedActionSource, { + shouldDirty: false, + }) + } + if (!getValues(fieldName("eventName"))) { + const { eventCatalog } = metaCapiActionSourcePolicy[storedActionSource] + setValue( + fieldName("eventName"), + defaultEventNameByCatalog[eventCatalog], + { + shouldDirty: false, + }, + ) + } + }, []) + + const actionSource = resolveMetaCapiActionSource( + useWatch({ control, name: fieldName("actionSource") }), + ) + const eventName: string = + useWatch({ control, name: fieldName("eventName") }) ?? "" + + const policy = metaCapiActionSourcePolicy[actionSource] + const catalogNames = useMemo( + () => new Set(eventNamesByCatalog[policy.eventCatalog]), + [policy.eventCatalog], + ) + const isCustomEvent = + policy.allowsCustomEventNames && !catalogNames.has(eventName) + + const actionSourceOptions = useMemo( + () => + metaCapiActionSourceValues.map((value) => ({ + value, + label: getMetaCapiActionSourceLabel(value, t), + })), + [t], + ) + + const contentTypeOptions = useMemo( + () => + metaCapiContentTypeValues.map((value) => ({ + value, + label: getMetaCapiContentTypeLabel(value, t), + })), + [t], + ) + + const catalogEventOptions = useMemo( + () => buildEventOptions(actionSource, t), + [actionSource, t], + ) + + // The "Custom event…" sentinel is never stored. While a custom name is + // active, its option `value` is swapped to the real (possibly still + // empty) `eventName` so `ComboboxField`'s field-value lookup resolves to + // it and keeps showing "Custom event…" as selected as the user types. + const eventOptions = useMemo( + () => + isCustomEvent + ? catalogEventOptions.map((option) => + option.value === CUSTOM_EVENT_OPTION + ? { ...option, value: eventName } + : option, + ) + : catalogEventOptions, + [catalogEventOptions, isCustomEvent, eventName], + ) + + const handleActionSourceChange = (nextValue?: string) => { + if (!nextValue) { + return + } + const nextActionSource = resolveMetaCapiActionSource(nextValue) + const currentEventName = getValues(fieldName("eventName")) + + if (isEventNameAllowedForActionSource(currentEventName, nextActionSource)) { + return + } + + const nextPolicy = metaCapiActionSourcePolicy[nextActionSource] + setValue( + fieldName("eventName"), + defaultEventNameByCatalog[nextPolicy.eventCatalog], + { shouldDirty: true, shouldValidate: true }, + ) + } + + // Picking "Custom event…" clears the name so the user can type one; the + // empty value is only validated on submit (or once they start typing), not + // the instant the option is chosen. The custom-name input owns the error + // display for that field while it is visible. + const handleEventSelect = (value: string) => { + const isCustomSelection = value === CUSTOM_EVENT_OPTION + setValue(fieldName("eventName"), isCustomSelection ? "" : value, { + shouldDirty: true, + shouldValidate: !isCustomSelection, + }) + } + + return ( +
+
+ + +
+ + {isCustomEvent ? ( + + ) : null} + + + + + +
+ + +
+

+ {t("metaConversions.flowStep.whatsappNote")} +

+ + + + + {t("metaConversions.dialog.advanced")} + + + + + + +
+ ) +} diff --git a/apps/builder/src/features/meta-conversions/components/purchase-number-field.tsx b/apps/builder/src/features/meta-conversions/components/purchase-number-field.tsx index 8c1aaeb1ac..29dac32670 100644 --- a/apps/builder/src/features/meta-conversions/components/purchase-number-field.tsx +++ b/apps/builder/src/features/meta-conversions/components/purchase-number-field.tsx @@ -12,7 +12,7 @@ type PurchaseNumberFieldProps = { } /** - * Numeric `contents[].quantity`/`contents[].itemPrice` field (plan #4) — the + * Numeric `contents[].quantity`/`contents[].itemPrice` field — the * shared `InputField` stores whatever string the user typed, but the * `contents[]` zod shape (`metaCapiPurchaseContentItemSchema`) requires real * `number`s, so this parses on change instead of leaving that to zod diff --git a/apps/builder/src/features/meta-conversions/lib/capi-connection-state.ts b/apps/builder/src/features/meta-conversions/lib/capi-connection-state.ts index 37f1c4b84f..84d16d3b0b 100644 --- a/apps/builder/src/features/meta-conversions/lib/capi-connection-state.ts +++ b/apps/builder/src/features/meta-conversions/lib/capi-connection-state.ts @@ -1,8 +1,23 @@ export type CapiConnectionState = | "connectedCustom" | "connectedOauth" + | "awaitingScope" | "disconnected" +/** + * A dataset already provisioned but with neither a manual token nor the + * Meta scope needed to send events: one reconnect-and-grant away from + * working, and the dataset id must stay visible meanwhile. + */ +export const isAwaitingCapiScope = (input: { + hasDatasetId?: boolean + hasManualCapiAccessToken?: boolean + hasCapiScope: boolean +}): boolean => + Boolean(input.hasDatasetId) && + !input.hasManualCapiAccessToken && + !input.hasCapiScope + /** * Derives the connection state shown by the CAPI tab. A user-intent * disconnect (capiDisconnected) overrides everything — the Meta-side scope @@ -12,6 +27,13 @@ export type CapiConnectionState = * (the chooser is shown): the method chooser's "Connect via Facebook" step * owns the dataset-finalize sub-flow, so there is no separate top-level * awaiting-dataset state. + * + * A dataset that was already provisioned (e.g. via "Create Dataset") but + * whose Meta scope is missing — no manual token either, so events cannot + * flow — renders as "awaitingScope": the dataset id must stay visible while + * the user is nudged to reconnect and grant the missing permission, rather + * than falling back to the method chooser and losing that dataset id from + * view. */ export function getCapiConnectionState(input: { capiDisconnected: boolean @@ -28,5 +50,8 @@ export function getCapiConnectionState(input: { if (input.hasCapiScope && input.hasDatasetId) { return "connectedOauth" } + if (isAwaitingCapiScope(input)) { + return "awaitingScope" + } return "disconnected" } diff --git a/apps/builder/src/features/meta-conversions/lib/capi-status.ts b/apps/builder/src/features/meta-conversions/lib/capi-status.ts index ae42fb8c73..ad2d1f05a8 100644 --- a/apps/builder/src/features/meta-conversions/lib/capi-status.ts +++ b/apps/builder/src/features/meta-conversions/lib/capi-status.ts @@ -1,4 +1,11 @@ -export type CapiStatus = "ready" | "notConnected" | "unverified" | "unsupported" +import { isAwaitingCapiScope } from "./capi-connection-state" + +export type CapiStatus = + | "ready" + | "notConnected" + | "missingPermission" + | "unverified" + | "unsupported" export const capiStatusConfig = { ready: { @@ -11,6 +18,11 @@ export const capiStatusConfig = { className: "border-border bg-muted text-muted-foreground", dotClassName: "bg-muted-foreground/60", }, + missingPermission: { + labelKey: "metaConversions.status.missingPermission", + className: "border-amber-200 bg-amber-50 text-amber-700", + dotClassName: "bg-amber-500", + }, unverified: { labelKey: "metaConversions.status.unverified", className: "border-border bg-muted text-muted-foreground", @@ -30,6 +42,16 @@ export const capiStatusConfig = { * In the pick-a-method connect flow, "not connected" covers every * non-ready state (never connected, permission declined, or user * disconnect) — the chooser below is the call to action either way. + * + * A dataset that is already provisioned but has neither a manual access + * token nor the Meta scope needed to send events is "missingPermission": + * the integration is not silently treated as never-connected, it is one + * reconnect-and-grant away from working. + * + * A user-intent disconnect wins over every readiness signal: the stored + * dataset, token and scope may all still be present, but the integration + * must read as "notConnected" — the same precedence `getCapiConnectionState` + * applies when it falls back to the method chooser. */ export function getCapiStatus(input: { hasCapiScope: boolean @@ -37,18 +59,25 @@ export function getCapiStatus(input: { hasDatasetId?: boolean credentialAvailable: boolean supported?: boolean + capiDisconnected?: boolean }): CapiStatus { if (input.supported === false) { return "unsupported" } + if (input.capiDisconnected) { + return "notConnected" + } if (input.hasManualCapiAccessToken && input.hasDatasetId) { return "ready" } if (input.hasCapiScope && input.hasDatasetId) { return "ready" } - if (input.credentialAvailable) { - return "notConnected" + if (!input.credentialAvailable) { + return "unverified" + } + if (isAwaitingCapiScope(input)) { + return "missingPermission" } - return "unverified" + return "notConnected" } diff --git a/apps/builder/src/features/meta-conversions/lib/event-catalog-options.ts b/apps/builder/src/features/meta-conversions/lib/event-catalog-options.ts new file mode 100644 index 0000000000..88a8190514 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/lib/event-catalog-options.ts @@ -0,0 +1,161 @@ +import { requireEventNameAllowedForActionSource } from "@chatbotx.io/flow-config" +import type { SelectOption } from "@chatbotx.io/ui/components/form/select-field" +import { + eventNamesByCatalog, + type MetaCapiActionSource, + type MetaCapiEventCatalog, + metaCapiActionSourcePolicy, + metaCapiActionSourceSchema, + type metaCapiBusinessMessagingEventNames, + type metaPixelStandardEventNames, +} from "@chatbotx.io/utils/meta-capi" +import type { useTranslations } from "next-intl" +import { z } from "zod" +import { getMetaCapiEventLabel } from "./event-label" + +type MetaCapiTranslator = ReturnType + +/** UI-only sentinel for "Custom event…" — never stored as `eventName`. */ +export const CUSTOM_EVENT_OPTION = "__custom__" + +type EventGroupKey = + | "commerce" + | "leads" + | "orders" + | "feedback" + | "leadsAndSignups" + | "other" + +const groupLabelKeys = { + commerce: "metaConversions.fields.eventType.groups.commerce", + leads: "metaConversions.fields.eventType.groups.leads", + orders: "metaConversions.fields.eventType.groups.orders", + feedback: "metaConversions.fields.eventType.groups.feedback", + leadsAndSignups: "metaConversions.fields.eventType.groups.leadsAndSignups", + other: "metaConversions.fields.eventType.groups.other", +} as const satisfies Record + +/** + * Business-messaging events grouped the way Meta documents them + * (https://developers.facebook.com/docs/marketing-api/conversions-api/business-messaging). + */ +const businessMessagingEventGroups: Record< + (typeof metaCapiBusinessMessagingEventNames)[number], + EventGroupKey +> = { + Purchase: "commerce", + InitiateCheckout: "commerce", + AddToCart: "commerce", + ViewContent: "commerce", + CartAbandoned: "commerce", + LeadSubmitted: "leads", + QualifiedLead: "leads", + OrderCreated: "orders", + OrderShipped: "orders", + OrderDelivered: "orders", + OrderCanceled: "orders", + OrderReturned: "orders", + RatingProvided: "feedback", + ReviewProvided: "feedback", +} + +/** + * Meta Pixel's 17 standard events grouped by intent + * (https://developers.facebook.com/docs/meta-pixel/reference). + */ +const pixelEventGroups: Record< + (typeof metaPixelStandardEventNames)[number], + EventGroupKey +> = { + AddPaymentInfo: "commerce", + AddToCart: "commerce", + AddToWishlist: "commerce", + CustomizeProduct: "commerce", + InitiateCheckout: "commerce", + Purchase: "commerce", + Search: "commerce", + ViewContent: "commerce", + CompleteRegistration: "leadsAndSignups", + Contact: "leadsAndSignups", + Lead: "leadsAndSignups", + Schedule: "leadsAndSignups", + StartTrial: "leadsAndSignups", + SubmitApplication: "leadsAndSignups", + Subscribe: "leadsAndSignups", + Donate: "other", + FindLocation: "other", +} + +/** Ordered group keys per catalog — controls the order groups render in. */ +const groupOrderByCatalog: Record = { + businessMessaging: ["commerce", "leads", "orders", "feedback"], + pixel: ["commerce", "leadsAndSignups", "other"], +} + +const eventGroupsByCatalog: Record< + MetaCapiEventCatalog, + Record +> = { + businessMessaging: businessMessagingEventGroups, + pixel: pixelEventGroups, +} + +/** + * Builds the `ComboboxField` option groups for an `action_source`'s event + * catalog: one `CommandGroup` per group key, in catalog order, plus a + * trailing "Custom event…" sentinel entry when the catalog allows custom + * names. + */ +export const buildEventOptions = ( + actionSource: MetaCapiActionSource, + t: MetaCapiTranslator, +): SelectOption[] => { + const policy = metaCapiActionSourcePolicy[actionSource] + const groupsForCatalog = eventGroupsByCatalog[policy.eventCatalog] + const namesForCatalog = eventNamesByCatalog[policy.eventCatalog] + + const options: SelectOption[] = groupOrderByCatalog[policy.eventCatalog].map( + (groupKey) => ({ + value: groupKey, + label: t(groupLabelKeys[groupKey]), + children: namesForCatalog + .filter((name) => groupsForCatalog[name] === groupKey) + .map((name) => ({ + value: name, + label: getMetaCapiEventLabel(name, t), + })), + }), + ) + + if (!policy.allowsCustomEventNames) { + return options + } + + return [ + ...options, + { + value: CUSTOM_EVENT_OPTION, + label: t("metaConversions.fields.eventType.custom"), + }, + ] +} + +/** + * Reuses the same `requireEventNameAllowedForActionSource` refinement the + * dialog's resolver and the trigger/flow-step schemas apply — no second + * copy of the catalog/reservation rules for the UI to drift from. + */ +const eventNameAllowedForActionSourceSchema = z + .object({ + eventName: z.string(), + actionSource: metaCapiActionSourceSchema, + }) + .superRefine(requireEventNameAllowedForActionSource) + +/** Authoritative "is this event name valid for this action source" check. */ +export const isEventNameAllowedForActionSource = ( + eventName: string, + actionSource: MetaCapiActionSource, +): boolean => + eventNameAllowedForActionSourceSchema.safeParse({ eventName, actionSource }) + .success diff --git a/apps/builder/src/features/meta-conversions/lib/event-label.ts b/apps/builder/src/features/meta-conversions/lib/event-label.ts new file mode 100644 index 0000000000..edcbf6fa0e --- /dev/null +++ b/apps/builder/src/features/meta-conversions/lib/event-label.ts @@ -0,0 +1,98 @@ +import type { + MetaCapiActionSource, + MetaCapiContentType, + metaCapiBusinessMessagingEventNames, + metaPixelStandardEventNames, +} from "@chatbotx.io/utils/meta-capi" +import type { useTranslations } from "next-intl" + +type MetaCapiTranslator = ReturnType + +/** Meta's official `action_source` docs, linked from the action-source field. */ +export const META_CAPI_ACTION_SOURCE_DOCS_URL = + "https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event#action_source" + +type KnownMetaCapiEventName = + | (typeof metaCapiBusinessMessagingEventNames)[number] + | (typeof metaPixelStandardEventNames)[number] + +/** + * One `Record` covering the union of both + * event catalogs (27 distinct names). Every standard event Meta documents — + * business-messaging or Pixel — resolves to a translated label; anything + * else falls through to the raw (already-validated) custom name in + * `getMetaCapiEventLabel`. + */ +const eventNameLabelKeys = { + Purchase: "metaConversions.fields.eventType.purchase", + LeadSubmitted: "metaConversions.fields.eventType.leadSubmitted", + InitiateCheckout: "metaConversions.fields.eventType.initiateCheckout", + AddToCart: "metaConversions.fields.eventType.addToCart", + ViewContent: "metaConversions.fields.eventType.viewContent", + OrderCreated: "metaConversions.fields.eventType.orderCreated", + OrderShipped: "metaConversions.fields.eventType.orderShipped", + OrderDelivered: "metaConversions.fields.eventType.orderDelivered", + OrderCanceled: "metaConversions.fields.eventType.orderCanceled", + OrderReturned: "metaConversions.fields.eventType.orderReturned", + CartAbandoned: "metaConversions.fields.eventType.cartAbandoned", + QualifiedLead: "metaConversions.fields.eventType.qualifiedLead", + RatingProvided: "metaConversions.fields.eventType.ratingProvided", + ReviewProvided: "metaConversions.fields.eventType.reviewProvided", + AddPaymentInfo: "metaConversions.fields.eventType.addPaymentInfo", + AddToWishlist: "metaConversions.fields.eventType.addToWishlist", + CompleteRegistration: "metaConversions.fields.eventType.completeRegistration", + Contact: "metaConversions.fields.eventType.contact", + CustomizeProduct: "metaConversions.fields.eventType.customizeProduct", + Donate: "metaConversions.fields.eventType.donate", + FindLocation: "metaConversions.fields.eventType.findLocation", + Lead: "metaConversions.fields.eventType.lead", + Schedule: "metaConversions.fields.eventType.schedule", + Search: "metaConversions.fields.eventType.search", + StartTrial: "metaConversions.fields.eventType.startTrial", + SubmitApplication: "metaConversions.fields.eventType.submitApplication", + Subscribe: "metaConversions.fields.eventType.subscribe", +} as const satisfies Record + +type EventLabelKey = (typeof eventNameLabelKeys)[KnownMetaCapiEventName] + +/** + * Standard event name → translated label; a custom event name (not a key of + * `eventNameLabelKeys`) is returned verbatim, already validated by + * `metaCapiEventNameSchema` upstream. Used by the fields component, the + * dialog's trigger-card summary, and the flow-step viewer, so the label + * logic lives in exactly one place. + */ +export const getMetaCapiEventLabel = ( + eventName: string, + t: MetaCapiTranslator, +): string => { + const key = (eventNameLabelKeys as Record)[ + eventName + ] + return key ? t(key) : eventName +} + +const actionSourceLabelKeys = { + business_messaging: "metaConversions.actionSource.business_messaging", + email: "metaConversions.actionSource.email", + phone_call: "metaConversions.actionSource.phone_call", + chat: "metaConversions.actionSource.chat", + physical_store: "metaConversions.actionSource.physical_store", + system_generated: "metaConversions.actionSource.system_generated", + other: "metaConversions.actionSource.other", +} as const satisfies Record + +export const getMetaCapiActionSourceLabel = ( + actionSource: MetaCapiActionSource, + t: MetaCapiTranslator, +): string => t(actionSourceLabelKeys[actionSource]) + +const contentTypeLabelKeys = { + product: "metaConversions.fields.contentType.product", + product_group: "metaConversions.fields.contentType.product_group", +} as const satisfies Record + +export const getMetaCapiContentTypeLabel = ( + contentType: MetaCapiContentType, + t: MetaCapiTranslator, +): string => t(contentTypeLabelKeys[contentType]) diff --git a/apps/builder/src/features/meta-conversions/lib/event-summary.ts b/apps/builder/src/features/meta-conversions/lib/event-summary.ts new file mode 100644 index 0000000000..604e35f950 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/lib/event-summary.ts @@ -0,0 +1,40 @@ +import type { MetaCapiEventFieldsSchema } from "@chatbotx.io/flow-config" +import { defaultMetaCapiActionSource } from "@chatbotx.io/utils/meta-capi" +import type { useTranslations } from "next-intl" +import { + getMetaCapiActionSourceLabel, + getMetaCapiEventLabel, +} from "./event-label" +import { resolveMetaCapiActionSource } from "./resolve-action-source" + +type MetaCapiTranslator = ReturnType + +type MetaCapiEventSummaryInput = Partial< + Pick< + MetaCapiEventFieldsSchema, + "eventName" | "actionSource" | "value" | "currency" + > +> + +/** + * Compact summary lines shown wherever a configured CAPI event is displayed + * without its form (flow-node viewer, step editor card): the event label, + * the action source when it is not the default, and value+currency when + * set. Tolerates legacy stored steps that predate `actionSource`/`eventName`. + */ +export const getMetaCapiEventSummaryLines = ( + fields: MetaCapiEventSummaryInput | undefined, + t: MetaCapiTranslator, +): string[] => { + const actionSource = resolveMetaCapiActionSource(fields?.actionSource) + const lines = [ + fields?.eventName ? getMetaCapiEventLabel(fields.eventName, t) : null, + actionSource === defaultMetaCapiActionSource + ? null + : getMetaCapiActionSourceLabel(actionSource, t), + fields?.value + ? [fields.value, fields.currency].filter(Boolean).join(" ") + : null, + ] + return lines.filter((line): line is string => Boolean(line)) +} diff --git a/apps/builder/src/features/meta-conversions/lib/find-capi-integration.ts b/apps/builder/src/features/meta-conversions/lib/find-capi-integration.ts new file mode 100644 index 0000000000..041a9b3953 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/lib/find-capi-integration.ts @@ -0,0 +1,43 @@ +import { + instagramIntegrationService, + integrationWhatsappService, + type MetaConversionsChannel, + type MetaConversionsIntegrationByChannel, + messengerIntegrationService, +} from "@chatbotx.io/business" + +type WorkspaceIntegrationRef = { id: string; workspaceId: string } + +type IntegrationLookup = ( + ref: WorkspaceIntegrationRef, +) => Promise + +const lookupByChannel: { + [TChannel in MetaConversionsChannel]: IntegrationLookup +} = { + // Messenger/Instagram lookups resolve `undefined` for a miss; normalise to + // `null` so every channel shares one return shape. + messenger: async (ref) => + (await messengerIntegrationService.findByIdForWorkspace(ref)) ?? null, + instagram: async (ref) => + (await instagramIntegrationService.findByIdForWorkspace(ref)) ?? null, + whatsapp: (ref) => integrationWhatsappService.findByIdForWorkspace(ref), +} + +/** + * Loads the CAPI-capable integration row for a channel, workspace-scoped. + * Lets one server action serve all three channels instead of three copies; + * the cast only re-states what the mapped-type map above already guarantees + * per key (TypeScript cannot narrow an indexed access on a generic key). + */ +export const findCapiIntegration = ( + channel: TChannel, + ref: WorkspaceIntegrationRef, +): Promise => + (lookupByChannel[channel] as IntegrationLookup)(ref) + +export const integrationNotFoundErrorKey = { + messenger: "messengerNotFound", + instagram: "instagramNotFound", + whatsapp: "whatsappNotFound", +} as const satisfies Record diff --git a/apps/builder/src/features/meta-conversions/lib/resolve-action-source.ts b/apps/builder/src/features/meta-conversions/lib/resolve-action-source.ts new file mode 100644 index 0000000000..e067840548 --- /dev/null +++ b/apps/builder/src/features/meta-conversions/lib/resolve-action-source.ts @@ -0,0 +1,20 @@ +import { + defaultMetaCapiActionSource, + type MetaCapiActionSource, + metaCapiActionSourceSchema, +} from "@chatbotx.io/utils/meta-capi" + +/** + * Flow versions saved before `actionSource` existed on this step/action + * carry no value for it at all, and the flow-step editor restores node data + * raw (no zod defaults applied on load) — so any UI reading `actionSource` + * off a legacy step must treat a missing or invalid value as + * `business_messaging` rather than passing it straight to a translator or a + * lookup keyed by `MetaCapiActionSource`. + */ +export const resolveMetaCapiActionSource = ( + value: string | undefined, +): MetaCapiActionSource => { + const result = metaCapiActionSourceSchema.safeParse(value) + return result.success ? result.data : defaultMetaCapiActionSource +} diff --git a/apps/builder/src/features/triggers/components/actions/editor.tsx b/apps/builder/src/features/triggers/components/actions/editor.tsx index 22917be204..c090383386 100644 --- a/apps/builder/src/features/triggers/components/actions/editor.tsx +++ b/apps/builder/src/features/triggers/components/actions/editor.tsx @@ -9,7 +9,7 @@ import { useTranslations } from "next-intl" import { SetCustomField } from "@/features/contacts/components/add-custom-field-dialog" import { CustomFieldSelect } from "@/features/custom-fields/custom-field-select" import { useFlowSelectOptions } from "@/features/flows/provider/flow-hook" -import { CapiEventFields } from "@/features/meta-conversions/components/capi-event-fields" +import { MetaCapiEventFields } from "@/features/meta-conversions/components/meta-capi-event-fields" import { useTagSelectOptions } from "@/features/tags/provider/tag-hook" import { GoogleSheetAction } from "./run-google-sheet" @@ -70,7 +70,7 @@ export const ActionEditor = ({ case triggerActions.enum.runGoogleSheet: return case triggerActions.enum.sendMetaCapiEvent: - return + return default: return null } diff --git a/apps/builder/src/features/triggers/components/actions/schema/send-meta-capi-event.ts b/apps/builder/src/features/triggers/components/actions/schema/send-meta-capi-event.ts index 6bc3f842f6..ecaa295e22 100644 --- a/apps/builder/src/features/triggers/components/actions/schema/send-meta-capi-event.ts +++ b/apps/builder/src/features/triggers/components/actions/schema/send-meta-capi-event.ts @@ -1,25 +1,23 @@ import { triggerActions } from "@chatbotx.io/database/partials" import { - metaCapiContentTextSchema, - metaCapiCurrencySchema, - metaCapiFlowEventNameSchema, - metaCapiValueSchema, + metaCapiEventFieldsSchema, + withMetaCapiEventRefinements, } from "@chatbotx.io/flow-config" import z from "zod" -export const sendMetaCapiEvent = z.object({ - type: z.literal(triggerActions.enum.sendMetaCapiEvent), - eventName: metaCapiFlowEventNameSchema.default("LeadSubmitted"), - value: metaCapiValueSchema, - currency: metaCapiCurrencySchema, - contentCategory: metaCapiContentTextSchema, - contentName: metaCapiContentTextSchema, -}) +export const sendMetaCapiEvent = withMetaCapiEventRefinements( + metaCapiEventFieldsSchema.extend({ + type: z.literal(triggerActions.enum.sendMetaCapiEvent), + }), +) export type SendMetaCapiEvent = z.infer export const defaultFn = (): SendMetaCapiEvent => ({ type: triggerActions.enum.sendMetaCapiEvent, eventName: "LeadSubmitted", + actionSource: "business_messaging", + contentType: undefined, + contentIds: undefined, value: undefined, currency: undefined, contentCategory: undefined, diff --git a/apps/worker/__tests__/action-executor-contact-inbox-attribution.test.ts b/apps/worker/__tests__/action-executor-contact-inbox-attribution.test.ts index 5aeeabaa7a..0cc9882ff7 100644 --- a/apps/worker/__tests__/action-executor-contact-inbox-attribution.test.ts +++ b/apps/worker/__tests__/action-executor-contact-inbox-attribution.test.ts @@ -20,8 +20,8 @@ const mocks = vi.hoisted(() => ({ findByIdForContact: vi.fn(), findMostRecentByContact: vi.fn(), insertReturning: vi.fn(), - enqueueLeadEvent: vi.fn(), - buildLeadSourceKey: vi.fn(), + enqueueEvent: vi.fn(), + buildSourceKey: vi.fn(), setValues: vi.fn(), deleteByCustomFieldId: vi.fn(), updateArchived: vi.fn(), @@ -112,9 +112,8 @@ vi.mock("@chatbotx.io/business", () => ({ mocks.enqueueTagAppliedEvaluations(...args), }, metaConversionsService: { - enqueueLeadEvent: (...args: unknown[]) => mocks.enqueueLeadEvent(...args), - buildLeadSourceKey: (...args: unknown[]) => - mocks.buildLeadSourceKey(...args), + enqueueEvent: (...args: unknown[]) => mocks.enqueueEvent(...args), + buildSourceKey: (...args: unknown[]) => mocks.buildSourceKey(...args), }, })) @@ -124,6 +123,24 @@ vi.mock("@chatbotx.io/events/context", () => ({ vi.mock("@chatbotx.io/logger", () => ({ default: { warn: vi.fn(), error: vi.fn(), info: vi.fn() }, + getChildLogger: () => ({ + warn: vi.fn(), + error: vi.fn(), + info: vi.fn(), + debug: vi.fn(), + }), +})) + +// This suite exercises the trigger-action switch with placeholder-free +// actions only — no template resolution is under test here (see +// send-meta-capi-event-step-handler.test.ts / trigger-action-executor-send- +// meta-capi-event.test.ts for that). Mocked as a passthrough so importing +// action-executor.ts does not pull in `@chatbotx.io/variables`'s real +// dependency chain (contact/custom-field/business-subpath modules this file +// does not otherwise mock). +vi.mock("@chatbotx.io/variables", () => ({ + resolveContactVariablesDeep: async (_contactId: string, value: unknown) => + value, })) vi.mock("@chatbotx.io/worker-config", () => ({ @@ -174,7 +191,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { // must win. mocks.findByIdForContact.mockResolvedValue(WHATSAPP_INBOX) mocks.findMostRecentByContact.mockResolvedValue(MESSENGER_INBOX) - mocks.buildLeadSourceKey.mockReturnValue("source-key") + mocks.buildSourceKey.mockReturnValue("source-key") mocks.flowFindFirst.mockResolvedValue({ id: "flow-1", currentVersionId: "fv-1", @@ -191,7 +208,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { contactInboxId: "ci-whatsapp", }) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith( + expect(mocks.enqueueEvent).toHaveBeenCalledWith( expect.objectContaining({ channel: "whatsapp", contactInboxId: "ci-whatsapp", @@ -222,7 +239,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { describe("fallback — no threaded contactInboxId", () => { test("sendMetaCapiEvent falls back to the most-recently-active inbox", async () => { mocks.findMostRecentByContact.mockResolvedValue(WHATSAPP_INBOX) - mocks.buildLeadSourceKey.mockReturnValue("source-key") + mocks.buildSourceKey.mockReturnValue("source-key") const executor = new ActionExecutor() await executor.execute({ @@ -237,7 +254,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { contactId: "contact-1", workspaceId: "ws-1", }) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith( + expect(mocks.enqueueEvent).toHaveBeenCalledWith( expect.objectContaining({ contactInboxId: "ci-whatsapp" }), ) }) @@ -247,7 +264,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { test("sendMetaCapiEvent falls back when the threaded contactInboxId doesn't resolve for this contact/workspace", async () => { mocks.findByIdForContact.mockResolvedValue(null) mocks.findMostRecentByContact.mockResolvedValue(MESSENGER_INBOX) - mocks.buildLeadSourceKey.mockReturnValue("source-key") + mocks.buildSourceKey.mockReturnValue("source-key") const executor = new ActionExecutor() await executor.execute({ @@ -258,7 +275,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { contactInboxId: "ci-stale", }) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith( + expect(mocks.enqueueEvent).toHaveBeenCalledWith( expect.objectContaining({ contactInboxId: "ci-messenger" }), ) }) @@ -292,7 +309,7 @@ describe("ActionExecutor — per-integration contact inbox attribution", () => { }), ).resolves.toBeUndefined() - expect(mocks.enqueueLeadEvent).not.toHaveBeenCalled() + expect(mocks.enqueueEvent).not.toHaveBeenCalled() expect(mocks.integrationQueueAdd).not.toHaveBeenCalled() expect(mocks.getSpreadsheetRow).not.toHaveBeenCalled() expect(baseLogger.warn).toHaveBeenCalled() diff --git a/apps/worker/__tests__/send-meta-capi-event-step-handler.test.ts b/apps/worker/__tests__/send-meta-capi-event-step-handler.test.ts index 2b38168a23..a4f2df9067 100644 --- a/apps/worker/__tests__/send-meta-capi-event-step-handler.test.ts +++ b/apps/worker/__tests__/send-meta-capi-event-step-handler.test.ts @@ -1,17 +1,27 @@ import { beforeEach, describe, expect, test, vi } from "vitest" +import { z } from "zod" // Covers the flow-step handler `handleSendMetaCapiEventStep` // (apps/worker/src/integration/handlers/meta-conversions/). It is the flow // builder's entry into the Meta CAPI pipeline: it gates the channel, derives // the workspace from the conversation, builds the deterministic per-step/day -// dedup `sourceKey`, threads the optional value/currency/content fields, and -// delegates to `metaConversionsService.enqueueLeadEvent`. The trigger-action -// path has its own coverage (trigger-action-executor-add-tag.test.ts); this is -// the parallel coverage for the flow-step path. +// dedup `sourceKey`, resolves any `{{variable}}` templates in +// value/currency/contentIds, threads the full field set, and delegates +// to `metaConversionsService.enqueueEvent`. The trigger-action path has its +// own coverage (trigger-action-executor-send-meta-capi-event.test.ts); this +// is the parallel coverage for the flow-step path. +// +// `contactVariableService.getAll` (not `resolveContactVariablesDeep` itself) +// is mocked, via the sibling `contact-variable` module it's actually defined +// in — mocking `resolveContactVariablesDeep` directly would make it +// impossible to assert "no placeholder → getAll not called", since that is +// exactly the real resolver's short-circuit behavior under test. const mocks = vi.hoisted(() => ({ - enqueueLeadEvent: vi.fn(), - buildLeadSourceKey: vi.fn(() => "flow:step-1:ci-1:key"), + enqueueEvent: vi.fn(), + buildSourceKey: vi.fn(() => "flow:step-1:ci-1:key"), + getAll: vi.fn(), + logProviderError: vi.fn(), })) vi.mock("@chatbotx.io/business", async () => { @@ -21,12 +31,29 @@ vi.mock("@chatbotx.io/business", async () => { return { ...actual, metaConversionsService: { - enqueueLeadEvent: mocks.enqueueLeadEvent, - buildLeadSourceKey: mocks.buildLeadSourceKey, + enqueueEvent: mocks.enqueueEvent, + buildSourceKey: mocks.buildSourceKey, }, } }) +vi.mock("../../../packages/variables/src/contact-variable", async () => { + const actual = await vi.importActual< + typeof import("../../../packages/variables/src/contact-variable") + >("../../../packages/variables/src/contact-variable") + return { + ...actual, + contactVariableService: { + ...actual.contactVariableService, + getAll: mocks.getAll, + }, + } +}) + +vi.mock("@chatbotx.io/business/error-log", () => ({ + logProviderError: (...args: unknown[]) => mocks.logProviderError(...args), +})) + vi.mock("../src/lib/logger", () => ({ logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn(), debug: vi.fn() }, })) @@ -35,10 +62,16 @@ const { handleSendMetaCapiEventStep } = await import( "../src/integration/handlers/meta-conversions/send-meta-capi-event-step-handler" ) +// Mirrors the business layer's `value` rule, so fixtures raise the same zod issue. +const plainNumberPattern = /^\d+(\.\d+)?$/ + const baseStep = { id: "step-1", stepType: "sendMetaCapiEvent" as const, eventName: "LeadSubmitted" as const, + actionSource: "business_messaging" as const, + contentType: undefined, + contentIds: undefined, value: undefined, currency: undefined, contentCategory: undefined, @@ -48,16 +81,40 @@ const baseStep = { function props(channel: string, step: typeof baseStep = baseStep) { return { contactInbox: { id: "ci-1", inboxId: "inbox-1", channel }, - conversation: { id: "conv-1", workspaceId: "ws-1" }, + conversation: { id: "conv-1", workspaceId: "ws-1", contactId: "contact-1" }, step, } as unknown as Parameters[0] } +// Minimal `contactVariableService.getAll`-shaped fixture: enough for the real +// `replaceAll`/`customFieldResolver` to resolve `{{amount}}` to a custom +// field's value without hitting the database. +function variableContext(customFieldValue: string) { + return { + contact: { id: "contact-1", timezone: null }, + contactInbox: null, + conversation: null, + customFieldsMap: new Map([ + [ + "amount", + { + key: "amount", + type: "text", + value: customFieldValue, + description: "", + }, + ], + ]), + botFieldsMap: new Map(), + workspace: null, + } +} + describe("handleSendMetaCapiEventStep", () => { beforeEach(() => { vi.clearAllMocks() - mocks.buildLeadSourceKey.mockReturnValue("flow:step-1:ci-1:key") - mocks.enqueueLeadEvent.mockResolvedValue({ id: "mce-1" }) + mocks.buildSourceKey.mockReturnValue("flow:step-1:ci-1:key") + mocks.enqueueEvent.mockResolvedValue({ id: "mce-1" }) }) test.each([ @@ -67,19 +124,24 @@ describe("handleSendMetaCapiEventStep", () => { ])("enqueues a lead event for supported channel %s with a channel-aware source key", async (channel) => { const result = await handleSendMetaCapiEventStep(props(channel)) - expect(mocks.buildLeadSourceKey).toHaveBeenCalledWith({ + expect(mocks.buildSourceKey).toHaveBeenCalledWith({ scope: "flow", scopeId: "step-1", contactInboxId: "ci-1", channel, + actionSource: "business_messaging", }) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith({ + expect(mocks.enqueueEvent).toHaveBeenCalledWith({ workspaceId: "ws-1", channel, contactInboxId: "ci-1", inboxId: "inbox-1", source: "flowStep", sourceKey: "flow:step-1:ci-1:key", + eventName: "LeadSubmitted", + actionSource: "business_messaging", + contentType: undefined, + contentIds: undefined, value: undefined, currency: undefined, contentCategory: undefined, @@ -88,10 +150,13 @@ describe("handleSendMetaCapiEventStep", () => { expect(result).toEqual({ status: "success", result: null }) }) - test("threads value, currency, and content fields to the enqueue", async () => { + test("threads actionSource, contentType, contentIds, value, currency, and content fields to the enqueue", async () => { await handleSendMetaCapiEventStep( props("messenger", { ...baseStep, + actionSource: "email" as const, + contentType: "product" as const, + contentIds: "sku-1,sku-2", value: "9.99", currency: "USD", contentCategory: "signup", @@ -99,8 +164,12 @@ describe("handleSendMetaCapiEventStep", () => { }), ) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith( + expect(mocks.getAll).not.toHaveBeenCalled() + expect(mocks.enqueueEvent).toHaveBeenCalledWith( expect.objectContaining({ + actionSource: "email", + contentType: "product", + contentIds: "sku-1,sku-2", value: "9.99", currency: "USD", contentCategory: "signup", @@ -109,15 +178,92 @@ describe("handleSendMetaCapiEventStep", () => { ) }) + test("no placeholder in value/currency/contentIds never loads contact variables", async () => { + await handleSendMetaCapiEventStep( + props("messenger", { ...baseStep, value: "9.99", currency: "USD" }), + ) + + expect(mocks.getAll).not.toHaveBeenCalled() + expect(mocks.enqueueEvent).toHaveBeenCalledWith( + expect.objectContaining({ value: "9.99", currency: "USD" }), + ) + }) + + test("resolves a {{variable}} template in value before enqueuing", async () => { + mocks.getAll.mockResolvedValue(variableContext("9.99")) + + await handleSendMetaCapiEventStep( + props("messenger", { ...baseStep, value: "{{amount}}", currency: "USD" }), + ) + + expect(mocks.getAll).toHaveBeenCalledTimes(1) + expect(mocks.enqueueEvent).toHaveBeenCalledWith( + expect.objectContaining({ value: "9.99", currency: "USD" }), + ) + }) + + // The same zod rejection `metaConversionsService.enqueueEvent` raises when + // a resolved template is not a plain number. + const invalidValueError = () => { + const result = z + .object({ + value: z + .string() + .regex( + plainNumberPattern, + "Value must be a plain number such as 19.99", + ), + }) + .safeParse({ value: "abc" }) + if (result.success) { + throw new Error("fixture must fail validation") + } + return result.error + } + + test("an invalid resolved value returns an error state AND is recorded in the workspace Error Log", async () => { + mocks.getAll.mockResolvedValue(variableContext("abc")) + mocks.enqueueEvent.mockRejectedValueOnce(invalidValueError()) + + const result = await handleSendMetaCapiEventStep( + props("messenger", { ...baseStep, value: "{{amount}}", currency: "USD" }), + ) + + expect(result.status).toBe("error") + if (result.status === "error") { + expect(result.errorMessage).toContain("Value must be a plain number") + expect(result.errorMessage).not.toContain('"issues"') + } + + expect(mocks.logProviderError).toHaveBeenCalledTimes(1) + const [logged] = mocks.logProviderError.mock.calls[0] as [ + { + provider: string + workspaceId: string + contactId: string + error: Error + }, + ] + expect(logged).toMatchObject({ + provider: "meta-conversions", + workspaceId: "ws-1", + contactId: "contact-1", + }) + expect(logged.error.message).toContain("Value must be a plain number") + // The Error Log entry names what the template actually resolved to. + expect(logged.error.message).toContain('value="abc"') + expect(logged.error.message).toContain('currency="USD"') + }) + test("returns an error for an unsupported channel without enqueuing", async () => { const result = await handleSendMetaCapiEventStep(props("telegram")) - expect(mocks.enqueueLeadEvent).not.toHaveBeenCalled() + expect(mocks.enqueueEvent).not.toHaveBeenCalled() expect(result.status).toBe("error") }) - test("returns an error when the enqueue fails", async () => { - mocks.enqueueLeadEvent.mockRejectedValueOnce(new Error("boom")) + test("a non-validation enqueue failure returns an error state without touching the Error Log", async () => { + mocks.enqueueEvent.mockRejectedValueOnce(new Error("boom")) const result = await handleSendMetaCapiEventStep(props("messenger")) @@ -125,5 +271,6 @@ describe("handleSendMetaCapiEventStep", () => { if (result.status === "error") { expect(result.errorMessage).toBe("boom") } + expect(mocks.logProviderError).not.toHaveBeenCalled() }) }) diff --git a/apps/worker/__tests__/send-meta-capi-event.test.ts b/apps/worker/__tests__/send-meta-capi-event.test.ts index cb573ae165..8e8dc324b6 100644 --- a/apps/worker/__tests__/send-meta-capi-event.test.ts +++ b/apps/worker/__tests__/send-meta-capi-event.test.ts @@ -106,6 +106,7 @@ const pendingEvent = { integrationId: "im-1", contactInboxId: "ci-1", eventName: "LeadSubmitted" as const, + actionSource: "business_messaging" as const, occurredAt: new Date("2026-08-10T10:00:00.000Z"), source: "flowStep" as const, sourceKey: "flow:step-1:ci-1:20260810", @@ -251,6 +252,56 @@ describe("handleSendMetaCapiEvent", () => { }) }) + test("forwards the integration's saved test_event_code to the send", async () => { + mocks.refreshCapiScopeCache.mockResolvedValue({ + ...integration, + capiTestEventCode: "TEST33520", + }) + + await handleSendMetaCapiEvent(jobData) + + expect(mocks.sendConversionEvent).toHaveBeenCalledWith( + expect.objectContaining({ testEventCode: "TEST33520" }), + ) + }) + + test("a manualTest event re-reads the integration and sends with the current test code", async () => { + mocks.findWorkspaceEvent.mockResolvedValue({ + ...pendingEvent, + source: "manualTest" as const, + }) + mocks.findMessengerIntegration.mockResolvedValue({ + ...integration, + capiTestEventCode: "TEST33520", + }) + + await handleSendMetaCapiEvent(jobData) + + // Once at job start, once again right before the send. + expect(mocks.findMessengerIntegration).toHaveBeenCalledTimes(2) + expect(mocks.sendConversionEvent).toHaveBeenCalledWith( + expect.objectContaining({ testEventCode: "TEST33520" }), + ) + }) + + test("a manualTest event whose test code was cleared is marked failed and never sent", async () => { + mocks.findWorkspaceEvent.mockResolvedValue({ + ...pendingEvent, + source: "manualTest" as const, + }) + + await handleSendMetaCapiEvent(jobData) + + expect(mocks.sendConversionEvent).not.toHaveBeenCalled() + expect(mocks.updateCapiStatus).toHaveBeenCalledWith( + expect.objectContaining({ + id: "mce-1", + to: "failed", + capiError: "testEventCodeMissing", + }), + ) + }) + test("threads limitedDataUse: true from the workspace onto the conversion event payload", async () => { mocks.findWorkspaceById.mockResolvedValue({ id: "ws-1", @@ -369,6 +420,66 @@ describe("handleSendMetaCapiEvent", () => { }) }) + test("forwards contentType and contentIds to the conversion event payload", async () => { + mocks.findWorkspaceEvent.mockResolvedValue({ + ...pendingEvent, + contentType: "product" as const, + contentIds: ["sku-1", "sku-2"], + }) + + await handleSendMetaCapiEvent(jobData) + + expect(mocks.sendConversionEvent).toHaveBeenCalledWith({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "LeadSubmitted", + occurredAt: pendingEvent.occurredAt, + eventId: "flow:step-1:ci-1:20260810", + messagingChannel: "messenger", + pageId: "page-1", + pageScopedUserId: "psid-1", + contentType: "product", + contentIds: ["sku-1", "sku-2"], + userData: CONTACT_1_USER_DATA, + }, + }) + }) + + test("a non-business_messaging action source identifies the person by hashed data only", async () => { + mocks.findWorkspaceEvent.mockResolvedValue({ + ...pendingEvent, + eventName: "Lead", + actionSource: "email" as const, + }) + + await handleSendMetaCapiEvent(jobData) + + expect(mocks.sendConversionEvent).toHaveBeenCalledWith({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "Lead", + occurredAt: pendingEvent.occurredAt, + eventId: "flow:step-1:ci-1:20260810", + actionSource: "email", + userData: CONTACT_1_USER_DATA, + }, + }) + // A non-messaging event has no channel identity to send, so it must + // always carry hashed customer info — `external_id` is the one field + // `hashContactUserData` never omits. + expect(mocks.sendConversionEvent).toHaveBeenCalledWith( + expect.objectContaining({ + event: expect.objectContaining({ + userData: expect.objectContaining({ + external_id: [CONTACT_1_EXTERNAL_ID_HASH], + }), + }), + }), + ) + }) + test("skips when the integration lacks CAPI scope", async () => { mocks.refreshCapiScopeCache.mockResolvedValue({ ...integration, @@ -608,6 +719,43 @@ describe("handleSendMetaCapiEvent", () => { }) }) + test("a whatsapp event with a non-messaging action source and no ctwa_clid is still sent", async () => { + // The ctwa_clid gate only applies when the action source actually uses + // the messaging identity (`business_messaging`) — an `email` action + // source identifies the person via hashed customer info instead, so a + // missing ctwa_clid must not skip it. + mocks.findWorkspaceEvent.mockResolvedValue({ + ...whatsappPendingEvent, + eventName: "Lead", + actionSource: "email" as const, + }) + mocks.findContactInbox.mockResolvedValue({ + ...whatsappContactInbox, + referral: null, + }) + + await handleSendMetaCapiEvent(jobData) + + expect(mocks.sendConversionEvent).toHaveBeenCalledWith({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "Lead", + occurredAt: whatsappPendingEvent.occurredAt, + eventId: "flow:step-1:ci-1:20260810", + actionSource: "email", + userData: CONTACT_1_USER_DATA, + }, + }) + expect(mocks.updateCapiStatus).toHaveBeenCalledWith({ + id: "mce-1", + workspaceId: "ws-1", + from: "pending", + to: "sent", + capiSentAt: expect.any(Date), + }) + }) + test("skips a whatsapp event whose contact has no ctwa_clid", async () => { mocks.findContactInbox.mockResolvedValue({ ...whatsappContactInbox, diff --git a/apps/worker/__tests__/trigger-action-executor-add-tag.test.ts b/apps/worker/__tests__/trigger-action-executor-add-tag.test.ts index af85746292..9e89411952 100644 --- a/apps/worker/__tests__/trigger-action-executor-add-tag.test.ts +++ b/apps/worker/__tests__/trigger-action-executor-add-tag.test.ts @@ -8,8 +8,8 @@ const mocks = vi.hoisted(() => ({ insertReturning: vi.fn(), enqueueAttach: vi.fn(), enqueueTagAppliedEvaluations: vi.fn(), - enqueueLeadEvent: vi.fn(), - buildLeadSourceKey: vi.fn(), + enqueueEvent: vi.fn(), + buildSourceKey: vi.fn(), })) vi.mock("@chatbotx.io/database/client", () => ({ @@ -69,9 +69,8 @@ vi.mock("@chatbotx.io/business", () => ({ mocks.enqueueTagAppliedEvaluations(...args), }, metaConversionsService: { - enqueueLeadEvent: (...args: unknown[]) => mocks.enqueueLeadEvent(...args), - buildLeadSourceKey: (...args: unknown[]) => - mocks.buildLeadSourceKey(...args), + enqueueEvent: (...args: unknown[]) => mocks.enqueueEvent(...args), + buildSourceKey: (...args: unknown[]) => mocks.buildSourceKey(...args), }, })) @@ -81,6 +80,24 @@ vi.mock("@chatbotx.io/events/context", () => ({ vi.mock("@chatbotx.io/logger", () => ({ default: { warn: vi.fn(), error: vi.fn(), info: vi.fn() }, + getChildLogger: () => ({ + warn: vi.fn(), + error: vi.fn(), + info: vi.fn(), + debug: vi.fn(), + }), +})) + +// This suite exercises the trigger-action switch with placeholder-free +// actions only — no template resolution is under test here (see +// send-meta-capi-event-step-handler.test.ts / trigger-action-executor-send- +// meta-capi-event.test.ts for that). Mocked as a passthrough so importing +// action-executor.ts does not pull in `@chatbotx.io/variables`'s real +// dependency chain (contact/custom-field/business-subpath modules this file +// does not otherwise mock). +vi.mock("@chatbotx.io/variables", () => ({ + resolveContactVariablesDeep: async (_contactId: string, value: unknown) => + value, })) vi.mock("@chatbotx.io/worker-config", () => ({ @@ -113,7 +130,7 @@ describe("ActionExecutor addTag", () => { inboxId: "inbox-1", channel: "messenger", }) - mocks.buildLeadSourceKey.mockReturnValue("trigger:trigger-1:ci-1:key") + mocks.buildSourceKey.mockReturnValue("trigger:trigger-1:ci-1:key") }) test("enqueues tag sync and ads conversion tagApplied evaluation for newly-linked tags", async () => { @@ -170,29 +187,8 @@ describe("ActionExecutor addTag", () => { expect(mocks.enqueueTagAppliedEvaluations).not.toHaveBeenCalled() }) - test("enqueues Meta CAPI trigger events with contact inbox source key and inbox id", async () => { - const executor = new ActionExecutor() - - await executor.execute({ - action: { type: "sendMetaCapiEvent" }, - contactId: "contact-1", - triggerId: "trigger-1", - workspaceId: "ws-1", - }) - - expect(mocks.buildLeadSourceKey).toHaveBeenCalledWith({ - scope: "trigger", - scopeId: "trigger-1", - contactInboxId: "ci-1", - channel: "messenger", - }) - expect(mocks.enqueueLeadEvent).toHaveBeenCalledWith({ - workspaceId: "ws-1", - channel: "messenger", - contactInboxId: "ci-1", - inboxId: "inbox-1", - source: "triggerAction", - sourceKey: "trigger:trigger-1:ci-1:key", - }) - }) + // Meta CAPI trigger-action coverage lives in + // trigger-action-executor-send-meta-capi-event.test.ts — it needs its own + // mocks for `@chatbotx.io/flow-config` (metaCapiEventFieldsSchema) and + // `@chatbotx.io/variables` (resolveContactVariablesDeep). }) diff --git a/apps/worker/__tests__/trigger-action-executor-bot-field.test.ts b/apps/worker/__tests__/trigger-action-executor-bot-field.test.ts index da4eb938dc..faa2cc1666 100644 --- a/apps/worker/__tests__/trigger-action-executor-bot-field.test.ts +++ b/apps/worker/__tests__/trigger-action-executor-bot-field.test.ts @@ -68,8 +68,8 @@ vi.mock("@chatbotx.io/business", () => ({ }, conversationService: {}, metaConversionsService: { - enqueueLeadEvent: vi.fn(), - buildLeadSourceKey: vi.fn(), + enqueueEvent: vi.fn(), + buildSourceKey: vi.fn(), }, tagSyncService: { enqueueAttach: vi.fn(), enqueueDetach: vi.fn() }, })) @@ -80,6 +80,24 @@ vi.mock("@chatbotx.io/events/context", () => ({ vi.mock("@chatbotx.io/logger", () => ({ default: { warn: vi.fn(), error: vi.fn(), info: vi.fn() }, + getChildLogger: () => ({ + warn: vi.fn(), + error: vi.fn(), + info: vi.fn(), + debug: vi.fn(), + }), +})) + +// This suite exercises the trigger-action switch with placeholder-free +// actions only — no template resolution is under test here (see +// send-meta-capi-event-step-handler.test.ts / trigger-action-executor-send- +// meta-capi-event.test.ts for that). Mocked as a passthrough so importing +// action-executor.ts does not pull in `@chatbotx.io/variables`'s real +// dependency chain (contact/custom-field/business-subpath modules this file +// does not otherwise mock). +vi.mock("@chatbotx.io/variables", () => ({ + resolveContactVariablesDeep: async (_contactId: string, value: unknown) => + value, })) vi.mock("@chatbotx.io/worker-config", () => ({ diff --git a/apps/worker/__tests__/trigger-action-executor-send-meta-capi-event.test.ts b/apps/worker/__tests__/trigger-action-executor-send-meta-capi-event.test.ts new file mode 100644 index 0000000000..7c0f18ec7f --- /dev/null +++ b/apps/worker/__tests__/trigger-action-executor-send-meta-capi-event.test.ts @@ -0,0 +1,374 @@ +import { beforeEach, describe, expect, test, vi } from "vitest" +import { z } from "zod" + +// Covers the `sendMetaCapiEvent` trigger-action branch of `ActionExecutor` +// (apps/worker/src/trigger/services/action-executor.ts). Parallel coverage +// to the flow-step path (send-meta-capi-event-step-handler.test.ts): the +// trigger executor validates the stored action against the shared +// `metaCapiEventFieldsSchema` + the same cross-field refinements the flow +// step uses, resolves any `{{variable}}` templates (passing +// `contactInbox.id` — a string — because `getContactInbox()` returns a +// narrow `ContactInboxWorkspaceRow`, not a full model), then delegates to +// `metaConversionsService.enqueueEvent`. +// +// `@chatbotx.io/variables` is mocked directly (unlike +// send-meta-capi-event-step-handler.test.ts, which exercises the real +// resolver against `contactVariableService.getAll`): this suite otherwise +// hard-mocks `@chatbotx.io/business`/`@chatbotx.io/database/*` the same way +// every other `trigger-action-executor-*` suite does, and the real resolver +// chain reaches several `@chatbotx.io/business` subpath modules +// (`/contact-locale`, `/system-field`, `/workspace-lifecycle/predicates`) +// that would need a real (not hard-mocked) database schema to load. The +// template-substitution behavior itself is already covered end-to-end by +// the step-handler suite; this suite only asserts the executor forwards +// `resolveContactVariablesDeep`'s result to `enqueueEvent`. + +// Mirrors the business layer's `value` rule, so fixtures raise the same zod issue. +const plainNumberPattern = /^\d+(\.\d+)?$/ + +const mocks = vi.hoisted(() => ({ + conversationFindFirst: vi.fn(), + findByIdForContact: vi.fn(), + findMostRecentByContact: vi.fn(), + enqueueEvent: vi.fn(), + buildSourceKey: vi.fn(), + logProviderError: vi.fn(), + resolveContactVariablesDeep: vi.fn( + async (_contactId: string, value: unknown) => value, + ), +})) + +vi.mock("@chatbotx.io/database/client", () => ({ + db: { + query: { + conversationModel: { + findFirst: (...args: unknown[]) => mocks.conversationFindFirst(...args), + }, + }, + insert: () => ({ + values: () => ({ + onConflictDoNothing: () => ({ returning: vi.fn() }), + }), + }), + delete: () => ({ where: vi.fn() }), + }, + and: (...args: unknown[]) => ({ and: args }), + eq: (col: unknown, val: unknown) => ({ eq: [col, val] }), + inArray: (col: unknown, vals: unknown) => ({ inArray: [col, vals] }), +})) + +vi.mock("@chatbotx.io/database/schema", () => ({ + contactsToTagsModel: { + contactId: "contactsToTagsModel.contactId", + tagId: "contactsToTagsModel.tagId", + }, + metaCapiEventChannelSchema: { + safeParse: (value: unknown) => + value === "messenger" || value === "instagram" || value === "whatsapp" + ? { success: true as const, data: value } + : { success: false as const }, + }, +})) + +vi.mock("@chatbotx.io/database/repositories", () => ({ + contactInboxRepository: { + findByIdForContact: (...args: unknown[]) => + mocks.findByIdForContact(...args), + findMostRecentByContact: (...args: unknown[]) => + mocks.findMostRecentByContact(...args), + }, +})) + +vi.mock("@chatbotx.io/business", () => ({ + contactCustomFieldService: {}, + conversationService: {}, + tagSyncService: {}, + adsConversionService: {}, + metaConversionsService: { + enqueueEvent: (...args: unknown[]) => mocks.enqueueEvent(...args), + buildSourceKey: (...args: unknown[]) => mocks.buildSourceKey(...args), + }, +})) + +vi.mock("@chatbotx.io/business/error-log", () => ({ + logProviderError: (...args: unknown[]) => mocks.logProviderError(...args), +})) + +vi.mock("@chatbotx.io/events/context", () => ({ + webhookChannelOrigin: vi.fn(() => "webhook"), +})) + +vi.mock("@chatbotx.io/logger", () => ({ + default: { warn: vi.fn(), error: vi.fn(), info: vi.fn() }, + getChildLogger: () => ({ + warn: vi.fn(), + error: vi.fn(), + info: vi.fn(), + debug: vi.fn(), + }), +})) + +vi.mock("@chatbotx.io/variables", () => ({ + resolveContactVariablesDeep: (...args: [string, unknown, unknown]) => + mocks.resolveContactVariablesDeep(...args), +})) + +vi.mock("@chatbotx.io/worker-config", () => ({ + IntegrationJobAction: { sendFlow: "sendFlow" }, + integrationQueue: { add: vi.fn() }, +})) + +vi.mock("../src/integration/handlers/spreadsheet-handler", () => ({ + clearSpreadsheetRow: vi.fn(), + getSpreadsheetRandomRow: vi.fn(), + getSpreadsheetRow: vi.fn(), + sendSpreadsheetData: vi.fn(), + updateSpreadsheetRow: vi.fn(), +})) + +const { ActionExecutor } = await import( + "../src/trigger/services/action-executor" +) +const baseLogger = (await import("@chatbotx.io/logger")).default + +describe("ActionExecutor sendMetaCapiEvent", () => { + beforeEach(() => { + vi.clearAllMocks() + mocks.resolveContactVariablesDeep.mockImplementation( + async (_contactId: string, value: unknown) => value, + ) + mocks.conversationFindFirst.mockResolvedValue({ + id: "conv-1", + contactId: "contact-1", + workspaceId: "ws-1", + }) + mocks.findMostRecentByContact.mockResolvedValue({ + id: "ci-1", + inboxId: "inbox-1", + channel: "messenger", + }) + mocks.buildSourceKey.mockReturnValue("trigger:trigger-1:ci-1:key") + }) + + test("happy path: enqueues the full field set with a channel-aware source key", async () => { + const executor = new ActionExecutor() + + await executor.execute({ + action: { + type: "sendMetaCapiEvent", + eventName: "AddToCart", + actionSource: "email", + contentType: "product", + contentIds: "sku-1,sku-2", + value: "9.99", + currency: "USD", + contentCategory: "signup", + contentName: "newsletter", + }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }) + + expect(mocks.resolveContactVariablesDeep).toHaveBeenCalledWith( + "contact-1", + { value: "9.99", currency: "USD", contentIds: "sku-1,sku-2" }, + expect.objectContaining({ contactInbox: "ci-1" }), + ) + expect(mocks.buildSourceKey).toHaveBeenCalledWith({ + scope: "trigger", + scopeId: "trigger-1", + contactInboxId: "ci-1", + channel: "messenger", + actionSource: "email", + }) + expect(mocks.enqueueEvent).toHaveBeenCalledWith({ + workspaceId: "ws-1", + channel: "messenger", + contactInboxId: "ci-1", + inboxId: "inbox-1", + source: "triggerAction", + sourceKey: "trigger:trigger-1:ci-1:key", + eventName: "AddToCart", + actionSource: "email", + contentType: "product", + contentIds: "sku-1,sku-2", + value: "9.99", + currency: "USD", + contentCategory: "signup", + contentName: "newsletter", + }) + }) + + test("forwards the resolved (post-template) value/currency/contentIds to the enqueue", async () => { + mocks.resolveContactVariablesDeep.mockResolvedValue({ + value: "42.00", + currency: "USD", + contentIds: undefined, + }) + + const executor = new ActionExecutor() + await executor.execute({ + action: { + type: "sendMetaCapiEvent", + eventName: "Purchase", + actionSource: "business_messaging", + value: "{{amount}}", + currency: "USD", + }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }) + + expect(mocks.enqueueEvent).toHaveBeenCalledWith( + expect.objectContaining({ value: "42.00", currency: "USD" }), + ) + }) + + test("stored old-shape action (five fields, no actionSource) still enqueues LeadSubmitted/business_messaging", async () => { + const executor = new ActionExecutor() + + await executor.execute({ + action: { + type: "sendMetaCapiEvent", + eventName: "LeadSubmitted", + value: "9.99", + currency: "USD", + contentCategory: "signup", + contentName: "newsletter", + }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }) + + expect(mocks.enqueueEvent).toHaveBeenCalledWith( + expect.objectContaining({ + eventName: "LeadSubmitted", + actionSource: "business_messaging", + value: "9.99", + currency: "USD", + }), + ) + }) + + test("unsupported channel warns and skips without enqueuing", async () => { + mocks.findMostRecentByContact.mockResolvedValue({ + id: "ci-tg", + inboxId: "inbox-tg", + channel: "telegram", + }) + + const executor = new ActionExecutor() + await expect( + executor.execute({ + action: { type: "sendMetaCapiEvent" }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }), + ).resolves.toBeUndefined() + + expect(mocks.enqueueEvent).not.toHaveBeenCalled() + expect(baseLogger.warn).toHaveBeenCalled() + }) + + test("invalid action (Purchase without value/currency) warns and skips without enqueuing", async () => { + const executor = new ActionExecutor() + await expect( + executor.execute({ + action: { type: "sendMetaCapiEvent", eventName: "Purchase" }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }), + ).resolves.toBeUndefined() + + expect(mocks.enqueueEvent).not.toHaveBeenCalled() + expect(mocks.resolveContactVariablesDeep).not.toHaveBeenCalled() + expect(baseLogger.warn).toHaveBeenCalled() + // A stored action the schema rejects is the workspace's configuration + // problem, so it is surfaced in the Error Log, not only the worker log. + expect(mocks.logProviderError).toHaveBeenCalledWith( + expect.objectContaining({ + provider: "meta-conversions", + workspaceId: "ws-1", + contactId: "contact-1", + }), + ) + const [logged] = mocks.logProviderError.mock.calls[0] as [{ error: Error }] + expect(logged.error.message).toContain("Value is required for Purchase") + }) + + test("a resolved template the enqueue rejects is recorded in the Error Log and still fails the action", async () => { + mocks.resolveContactVariablesDeep.mockResolvedValueOnce({ + value: "250Hung", + currency: "VND", + contentIds: undefined, + }) + const validation = z + .object({ + value: z + .string() + .regex( + plainNumberPattern, + "Value must be a plain number such as 19.99", + ), + }) + .safeParse({ value: "250Hung" }) + if (validation.success) { + throw new Error("fixture must fail validation") + } + mocks.enqueueEvent.mockRejectedValueOnce(validation.error) + + const executor = new ActionExecutor() + await expect( + executor.execute({ + action: { + type: "sendMetaCapiEvent", + eventName: "Purchase", + actionSource: "email", + value: "250{{first_name}}", + currency: "VND", + }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }), + ).rejects.toBe(validation.error) + + expect(mocks.logProviderError).toHaveBeenCalledTimes(1) + const [logged] = mocks.logProviderError.mock.calls[0] as [ + { + provider: string + workspaceId: string + contactId: string + error: Error + }, + ] + expect(logged).toMatchObject({ + provider: "meta-conversions", + workspaceId: "ws-1", + contactId: "contact-1", + }) + expect(logged.error.message).toContain("Value must be a plain number") + expect(logged.error.message).toContain('value="250Hung"') + }) + + test("a non-validation enqueue failure propagates without touching the Error Log", async () => { + mocks.enqueueEvent.mockRejectedValueOnce(new Error("boom")) + + const executor = new ActionExecutor() + await expect( + executor.execute({ + action: { type: "sendMetaCapiEvent", eventName: "LeadSubmitted" }, + contactId: "contact-1", + triggerId: "trigger-1", + workspaceId: "ws-1", + }), + ).rejects.toThrow("boom") + + expect(mocks.logProviderError).not.toHaveBeenCalled() + }) +}) diff --git a/apps/worker/src/integration/handlers/meta-conversions/capi-input-error.ts b/apps/worker/src/integration/handlers/meta-conversions/capi-input-error.ts new file mode 100644 index 0000000000..22bd04895e --- /dev/null +++ b/apps/worker/src/integration/handlers/meta-conversions/capi-input-error.ts @@ -0,0 +1,81 @@ +import { metaConversionsService } from "@chatbotx.io/business" +import { logProviderError } from "@chatbotx.io/business/error-log" +import { z } from "zod" +import { isZodLikeError } from "./sanitize-capi-error" + +type EnqueueEventInput = Parameters< + typeof metaConversionsService.enqueueEvent +>[0] + +type ResolvedCapiFields = { + value?: string | null + currency?: string | null + contentIds?: string | null +} + +/** + * Human-readable summary for the workspace Error Log: zod's per-field + * message plus the resolved values the templates actually produced, so the + * user can see *what* the variable turned into rather than only that a + * field was rejected. + */ +export function describeCapiInputValidationError( + error: z.ZodError, + resolved: ResolvedCapiFields = {}, +): string { + const resolvedEntries = Object.entries(resolved).filter( + ([, fieldValue]) => typeof fieldValue === "string" && fieldValue.length > 0, + ) + const lines = [z.prettifyError(error)] + if (resolvedEntries.length > 0) { + const summary = resolvedEntries + .map(([field, fieldValue]) => `${field}=${JSON.stringify(fieldValue)}`) + .join(", ") + lines.push(`Resolved: ${summary}`) + } + return lines.join("\n") +} + +/** + * Surfaces a Meta CAPI configuration/template failure in the workspace + * Error Log — the same place a Meta-side send failure lands — instead of + * only in the worker's own logs. Never throws (`logProviderError` swallows). + */ +export async function reportCapiInputFailure(input: { + workspaceId: string + contactId?: string | null + message: string +}): Promise { + await logProviderError({ + provider: "meta-conversions", + workspaceId: input.workspaceId, + contactId: input.contactId, + error: new Error(input.message), + httpCode: null, + }) +} + +/** + * Enqueues a CAPI event for the flow-step and trigger-action pipelines. A + * `{{variable}}` template that resolved to something the business schema + * rejects (e.g. `value` → "250Hung") is the workspace's configuration + * problem, so it is recorded in the Error Log before the failure propagates; + * anything else (DB, queue) stays a platform error and propagates untouched. + */ +export async function enqueueCapiEvent( + input: EnqueueEventInput, + context: { contactId: string; resolved: ResolvedCapiFields }, +): Promise { + try { + await metaConversionsService.enqueueEvent(input) + } catch (error) { + if (isZodLikeError(error)) { + await reportCapiInputFailure({ + workspaceId: input.workspaceId, + contactId: context.contactId, + message: describeCapiInputValidationError(error, context.resolved), + }) + } + throw error + } +} diff --git a/apps/worker/src/integration/handlers/meta-conversions/sanitize-capi-error.ts b/apps/worker/src/integration/handlers/meta-conversions/sanitize-capi-error.ts index b6819a1082..b46145db8b 100644 --- a/apps/worker/src/integration/handlers/meta-conversions/sanitize-capi-error.ts +++ b/apps/worker/src/integration/handlers/meta-conversions/sanitize-capi-error.ts @@ -1,11 +1,22 @@ +import { z } from "zod" + export type SanitizedCapiError = { message: string code?: string | number } +/** + * Structural check (an `Error` carrying an `issues` array) rather than + * `instanceof ZodError`, so a second `zod` copy in the dependency graph + * cannot make the check silently miss. + */ +export const isZodLikeError = (error: unknown): error is z.ZodError => + error instanceof Error && + Array.isArray((error as { issues?: unknown }).issues) + /** * Reduces an unknown CAPI/Ads-conversion send failure to a message+code - * record safe to log — NEVER the raw error object (Codex #7). A Graph/ + * record safe to log — NEVER the raw error object. A Graph/ * WhatsApp HTTP error's wrapped `origin` can carry the outgoing request, * including the Authorization header for manual CAPI tokens (see * `send-meta-capi-event.ts`'s inline comment on the same risk) — logging the @@ -18,7 +29,9 @@ export function sanitizeCapiError(error: unknown): SanitizedCapiError { if (error instanceof Error) { const code = (error as { code?: unknown }).code return { - message: error.message, + // A zod error's `.message` is a JSON dump of its issues; the pretty + // form ("✖ … → at value") is what belongs in a step error message. + message: isZodLikeError(error) ? z.prettifyError(error) : error.message, ...(typeof code === "string" || typeof code === "number" ? { code } : {}), } } diff --git a/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event-step-handler.ts b/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event-step-handler.ts index 3a271ff096..c5d85d9810 100644 --- a/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event-step-handler.ts +++ b/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event-step-handler.ts @@ -1,23 +1,12 @@ -import { - type MetaConversionsChannel, - metaConversionsService, -} from "@chatbotx.io/business" +import { metaConversionsService } from "@chatbotx.io/business" +import { metaCapiEventChannelSchema } from "@chatbotx.io/database/schema" import type { SendMetaCapiEventSchema } from "@chatbotx.io/flow-config" +import { resolveContactVariablesDeep } from "@chatbotx.io/variables" import { logger } from "../../../lib/logger" import type { ExecuteStepProps } from "../flow-utils" import type { ExecuteStepResult } from "../step" - -const supportedChannels = new Set([ - "messenger", - "instagram", - "whatsapp", -]) - -function isMetaConversionsChannel( - channel: string, -): channel is MetaConversionsChannel { - return supportedChannels.has(channel) -} +import { enqueueCapiEvent } from "./capi-input-error" +import { sanitizeCapiError } from "./sanitize-capi-error" export async function handleSendMetaCapiEventStep( props: ExecuteStepProps, @@ -25,37 +14,67 @@ export async function handleSendMetaCapiEventStep( const { contactInbox, conversation, step } = props try { - if (!isMetaConversionsChannel(contactInbox.channel)) { + const capiChannel = metaCapiEventChannelSchema.safeParse( + contactInbox.channel, + ) + if (!capiChannel.success) { return { status: "error", result: null, errorMessage: `Unsupported Meta CAPI channel: ${contactInbox.channel}`, } } + const channel = capiChannel.data + + // Resolve any `{{variable}}` templates in value/currency/contentIds + // before validating/enqueuing. `resolveContactVariablesDeep` is a no-op + // (no extra DB work) when none of these three fields contain a + // placeholder, so a step with only static values stays on the hot path. + const resolved = await resolveContactVariablesDeep( + conversation.contactId, + { + value: step.value, + currency: step.currency, + contentIds: step.contentIds, + }, + { contactInbox, conversation }, + ) - await metaConversionsService.enqueueLeadEvent({ - workspaceId: conversation.workspaceId, - channel: contactInbox.channel, - contactInboxId: contactInbox.id, - inboxId: contactInbox.inboxId, - source: "flowStep", - sourceKey: metaConversionsService.buildLeadSourceKey({ - scope: "flow", - scopeId: step.id, + await enqueueCapiEvent( + { + workspaceId: conversation.workspaceId, + channel, contactInboxId: contactInbox.id, - channel: contactInbox.channel, - }), - value: step.value, - currency: step.currency, - contentCategory: step.contentCategory, - contentName: step.contentName, - }) + inboxId: contactInbox.inboxId, + source: "flowStep", + sourceKey: metaConversionsService.buildSourceKey({ + scope: "flow", + scopeId: step.id, + contactInboxId: contactInbox.id, + channel, + actionSource: step.actionSource, + }), + eventName: step.eventName, + actionSource: step.actionSource, + contentType: step.contentType, + contentIds: resolved.contentIds, + value: resolved.value, + currency: resolved.currency, + contentCategory: step.contentCategory, + contentName: step.contentName, + }, + { contactId: conversation.contactId, resolved }, + ) return { status: "success", result: null } } catch (error) { + // Never log the raw error: a resolved template can carry the request's + // Authorization header via a wrapped Graph/business-layer error — see + // `sanitize-capi-error.ts`. + const sanitized = sanitizeCapiError(error) logger.warn( { - err: error, + err: sanitized, workspaceId: conversation.workspaceId, conversationId: conversation.id, contactInboxId: contactInbox.id, @@ -67,10 +86,7 @@ export async function handleSendMetaCapiEventStep( return { status: "error", result: null, - errorMessage: - error instanceof Error - ? error.message - : "Failed to enqueue Meta CAPI event", + errorMessage: sanitized.message, } } } diff --git a/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event.ts b/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event.ts index af45df54d3..f86dc40bf7 100644 --- a/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event.ts +++ b/apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event.ts @@ -1,4 +1,5 @@ import { + capiEventRequiresCtwaClid, contactInboxService, contactService, hashContactUserData, @@ -10,13 +11,19 @@ import { workspaceService, } from "@chatbotx.io/business" import { logProviderError } from "@chatbotx.io/business/error-log" +import type { MetaCapiEventModel } from "@chatbotx.io/database/types" import { buildDatasetName, ensureDataset, type MetaCapiEventName, sendConversionEvent, } from "@chatbotx.io/integration-meta-conversions" -import type { HashedCapiUserData } from "@chatbotx.io/utils/meta-capi" +import { + type HashedCapiUserData, + type MetaCapiActionSource, + type MetaCapiContentType, + metaCapiActionSourcePolicy, +} from "@chatbotx.io/utils/meta-capi" import type { IntegrationJobSendMetaCapiEvent } from "@chatbotx.io/worker-config" import { logger } from "../../../lib/logger" import { @@ -39,7 +46,12 @@ const skippedDisconnectedStatus = { // WhatsApp business-messaging CAPI requires a ctwa_clid (click-to-WhatsApp ad // identifier), which only exists for contacts that arrived via a CTWA ad — -// this is a Meta constraint, not a transient failure. +// this is a Meta constraint, not a transient failure. Only relevant when the +// event's action source actually uses the messaging identity +// (`metaCapiActionSourcePolicy[actionSource].usesMessagingIdentity`) — a +// WhatsApp event sent with a non-messaging action source (e.g. `email`) +// identifies the person via hashed customer info instead and never needs a +// ctwa_clid. const skippedNoIdentityStatus = { from: "pending", to: "skipped_no_identity", @@ -55,14 +67,82 @@ const sentStatus = { to: "sent", } as const +// The only channel-aware code left in this file. Each builder returns +// exactly the business-messaging identity keys Meta's endpoint requires for +// that channel; everything else below (custom data, LDU, hashed user data) +// is shared/channel-agnostic. Used only when +// `metaCapiActionSourcePolicy[actionSource].usesMessagingIdentity` is true. +type ChannelIdentityInput = { + sourceId: string + ctwaClid?: string | null +} + +const channelIdentityBuilders = { + messenger: ( + integration: MetaConversionsIntegrationByChannel["messenger"], + contactInbox: ChannelIdentityInput, + ) => ({ + messagingChannel: "messenger" as const, + pageId: integration.pageId, + pageScopedUserId: contactInbox.sourceId, + }), + instagram: ( + integration: MetaConversionsIntegrationByChannel["instagram"], + contactInbox: ChannelIdentityInput, + ) => ({ + messagingChannel: "instagram" as const, + instagramBusinessAccountId: integration.igId, + igSid: contactInbox.sourceId, + }), + whatsapp: ( + integration: MetaConversionsIntegrationByChannel["whatsapp"], + contactInbox: ChannelIdentityInput, + ) => { + if (!contactInbox.ctwaClid) { + // Defensive: the handler already gates on this via `skipped_no_identity` + // before calling `sendConversionEvent` — this should be unreachable. + throw new Error("Missing ctwa_clid for WhatsApp Meta CAPI event") + } + return { + messagingChannel: "whatsapp" as const, + wabaId: integration.wabaId, + ctwaClid: contactInbox.ctwaClid, + } + }, +} satisfies { + [TChannel in MetaConversionsChannel]: ( + integration: MetaConversionsIntegrationByChannel[TChannel], + contactInbox: ChannelIdentityInput, + ) => Record +} + +// Indexing `channelIdentityBuilders` by a generic `TChannel` narrows the +// integration parameter to the INTERSECTION of all three channels' shapes — +// a shape no single value can satisfy structurally, even though the caller's +// channel tag guarantees the match is safe at runtime. This is the ONE +// documented cast in this file, mirroring `byMessagingChannel` in +// `integrations/meta-conversions/src/apis/events.ts`. +function buildChannelIdentity( + channel: TChannel, + integration: MetaConversionsIntegrationByChannel[TChannel], + contactInbox: ChannelIdentityInput, +): ReturnType<(typeof channelIdentityBuilders)[TChannel]> { + const builder = channelIdentityBuilders[channel] as unknown as ( + integration: MetaConversionsIntegrationByChannel[TChannel], + contactInbox: ChannelIdentityInput, + ) => ReturnType<(typeof channelIdentityBuilders)[TChannel]> + return builder(integration, contactInbox) +} + function buildEventPayload(input: { channel: TChannel accessToken: string datasetId: string - // Widened to MetaCapiEventName (Phase 1 schema change) so this payload - // builder compiles against the DB row's type; actually sending "Purchase" - // events is Phase 3 work, not implemented here. + // Any Meta event name allowed by the row's action-source event catalog + // (business-messaging's 14 documented events, or a Pixel standard/custom + // name) — validated upstream by `requireEventNameAllowedForActionSource`. eventName: MetaCapiEventName + actionSource: MetaCapiActionSource occurredAt: Date eventId: string contactInboxSourceId: string @@ -71,71 +151,37 @@ function buildEventPayload(input: { currency?: string | null contentCategory?: string | null contentName?: string | null - userData?: HashedCapiUserData + contentType?: MetaCapiContentType | null + contentIds?: string[] | null + // Always populated by the caller (`hashContactUserData` always emits at + // least `external_id`) — required so a non-messaging identity can never be + // built without hashed customer info to identify the person by. + userData: HashedCapiUserData limitedDataUse?: boolean integration: MetaConversionsIntegrationByChannel[TChannel] }) { - if (input.channel === "messenger") { - const integration = - input.integration as MetaConversionsIntegrationByChannel["messenger"] - return { - datasetId: input.datasetId, - accessToken: input.accessToken, - event: { - eventName: input.eventName, - occurredAt: input.occurredAt, - eventId: input.eventId, - messagingChannel: "messenger" as const, - pageId: integration.pageId, - pageScopedUserId: input.contactInboxSourceId, - ...(input.value ? { value: input.value } : {}), - ...(input.currency ? { currency: input.currency } : {}), - ...(input.contentCategory - ? { contentCategory: input.contentCategory } - : {}), - ...(input.contentName ? { contentName: input.contentName } : {}), - ...(input.userData ? { userData: input.userData } : {}), - ...(input.limitedDataUse - ? { limitedDataUse: input.limitedDataUse } - : {}), - }, - } - } + const policy = metaCapiActionSourcePolicy[input.actionSource] - if (input.channel === "whatsapp") { - const integration = - input.integration as MetaConversionsIntegrationByChannel["whatsapp"] - if (!input.ctwaClid) { - // Defensive: the handler already gates on this via `skipped_no_identity` - // before calling `sendConversionEvent` — this should be unreachable. - throw new Error("Missing ctwa_clid for WhatsApp Meta CAPI event") - } - return { - datasetId: input.datasetId, - accessToken: input.accessToken, - event: { - eventName: input.eventName, - occurredAt: input.occurredAt, - eventId: input.eventId, - messagingChannel: "whatsapp" as const, - wabaId: integration.wabaId, + // Only `business_messaging` identifies the person by their per-channel + // messaging id (page-scoped id / IG sid / ctwa_clid); every other action + // source identifies them via hashed customer info only (`userData` below) + // — `NonMessagingIdentity` on the integration side. + const identity = policy.usesMessagingIdentity + ? buildChannelIdentity(input.channel, input.integration, { + sourceId: input.contactInboxSourceId, ctwaClid: input.ctwaClid, - ...(input.value ? { value: input.value } : {}), - ...(input.currency ? { currency: input.currency } : {}), - ...(input.contentCategory - ? { contentCategory: input.contentCategory } - : {}), - ...(input.contentName ? { contentName: input.contentName } : {}), - ...(input.userData ? { userData: input.userData } : {}), - ...(input.limitedDataUse - ? { limitedDataUse: input.limitedDataUse } - : {}), - }, - } - } + }) + : { + // Structurally safe even though TS can't derive it from the boolean + // lookup: `usesMessagingIdentity` is true only for + // `business_messaging` (see `metaCapiActionSourcePolicy`), so this + // branch's `actionSource` is never `business_messaging`. + actionSource: input.actionSource as Exclude< + MetaCapiActionSource, + "business_messaging" + >, + } - const integration = - input.integration as MetaConversionsIntegrationByChannel["instagram"] return { datasetId: input.datasetId, accessToken: input.accessToken, @@ -143,21 +189,49 @@ function buildEventPayload(input: { eventName: input.eventName, occurredAt: input.occurredAt, eventId: input.eventId, - messagingChannel: "instagram" as const, - instagramBusinessAccountId: integration.igId, - igSid: input.contactInboxSourceId, + ...identity, + // Hashed customer info rides along for every action source; for a + // non-messaging source it is the only identity Meta receives. + userData: input.userData, ...(input.value ? { value: input.value } : {}), ...(input.currency ? { currency: input.currency } : {}), ...(input.contentCategory ? { contentCategory: input.contentCategory } : {}), ...(input.contentName ? { contentName: input.contentName } : {}), - ...(input.userData ? { userData: input.userData } : {}), + ...(input.contentType ? { contentType: input.contentType } : {}), + ...(input.contentIds && input.contentIds.length > 0 + ? { contentIds: input.contentIds } + : {}), ...(input.limitedDataUse ? { limitedDataUse: input.limitedDataUse } : {}), }, } } +/** + * The Events Manager `test_event_code` to send with this event, if any. A + * "Send test event" must never reach production reporting, so for a + * `manualTest` event the integration row is re-read right here — after all + * other pre-send work — so a clear that raced the job is honoured; every + * other event uses the row already loaded for the send. + */ +async function resolveTestEventCode( + event: Pick< + MetaCapiEventModel, + "source" | "channel" | "integrationId" | "workspaceId" + >, + integration: { capiTestEventCode: string | null }, +): Promise { + if (event.source !== "manualTest") { + return integration.capiTestEventCode ?? undefined + } + const latest = await findEventIntegration(event.channel, { + integrationId: event.integrationId, + workspaceId: event.workspaceId, + }) + return latest?.capiTestEventCode ?? undefined +} + export async function handleSendMetaCapiEvent( data: SendMetaCapiEventData, ): Promise { @@ -204,7 +278,7 @@ export async function handleSendMetaCapiEvent( return } - // Limited Data Use (plan #3): read once per event, OUTSIDE the try/catch + // Limited Data Use: read once per event, OUTSIDE the try/catch // below so a read failure (DB/Redis blip, workspace gone) throws and // propagates out of `withBlockedOwnerGuard` for a BullMQ retry instead of // being caught and silently sent with the wrong LDU state. @@ -234,7 +308,7 @@ export async function handleSendMetaCapiEvent( return } - // Defense-in-depth identity check (Phase 0 — Codex CRITICAL#1): mirrors + // Defense-in-depth identity check: mirrors // `handleSendMetaChannelConversionEvent`'s guard in // `send-conversion-event.ts`. `contactInbox` above is looked up by id // alone (no workspace/inbox scoping in the query itself), and it powers @@ -274,11 +348,14 @@ export async function handleSendMetaCapiEvent( return } - // WhatsApp business-messaging CAPI cannot send without a ctwa_clid, so - // gate BEFORE any token/scope/dataset work: an unsendable event is - // terminally skipped_no_identity (never skipped_no_scope), and we avoid a - // wasted debug-token round-trip when scope also happens to be missing. - if (event.channel === "whatsapp" && !contactInbox.referral?.ctwaClid) { + // A channel whose messaging identity is keyed to an ad click cannot + // send without the click id, so gate BEFORE any token/scope/dataset + // work: an unsendable event is terminally skipped_no_identity (never + // skipped_no_scope), and no debug-token round-trip is wasted. + if ( + capiEventRequiresCtwaClid(event.channel, event.actionSource) && + !contactInbox.referral?.ctwaClid + ) { await metaConversionsService.updateCapiStatus({ id: event.id, workspaceId: event.workspaceId, @@ -311,6 +388,20 @@ export async function handleSendMetaCapiEvent( return } + const testEventCode = await resolveTestEventCode( + event, + integrationForSend, + ) + if (event.source === "manualTest" && !testEventCode) { + await metaConversionsService.updateCapiStatus({ + id: event.id, + workspaceId: event.workspaceId, + ...failedStatus, + capiError: "testEventCodeMissing", + }) + return + } + const datasetId = auth.source === "manual" && integrationForSend.datasetId ? integrationForSend.datasetId @@ -329,17 +420,19 @@ export async function handleSendMetaCapiEvent( }), }) - // Customer-info matching (plan #1) — `contactInboxContact` was already + // Customer-info matching — `contactInboxContact` was already // resolved and workspace/inbox-validated by the Phase 0 guard above, so // it is safe to hash and send. const userData = await hashContactUserData(contactInboxContact) - await sendConversionEvent( - buildEventPayload({ + await sendConversionEvent({ + testEventCode, + ...buildEventPayload({ channel: event.channel, accessToken: auth.accessToken, datasetId, eventName: event.eventName, + actionSource: event.actionSource, occurredAt: event.occurredAt, eventId: event.sourceKey, contactInboxSourceId: contactInbox.sourceId, @@ -348,11 +441,13 @@ export async function handleSendMetaCapiEvent( currency: event.currency, contentCategory: event.contentCategory, contentName: event.contentName, + contentType: event.contentType, + contentIds: event.contentIds, userData, limitedDataUse: workspace.capiLimitedDataUse, integration: integrationForSend, }), - ) + }) } catch (error) { if (error instanceof Error && "retryable" in error && error.retryable) { throw error diff --git a/apps/worker/src/schedule/handlers/purge-automation-throttle.ts b/apps/worker/src/schedule/handlers/purge-automation-throttle.ts index 276a6d9cbf..96975d430d 100644 --- a/apps/worker/src/schedule/handlers/purge-automation-throttle.ts +++ b/apps/worker/src/schedule/handlers/purge-automation-throttle.ts @@ -10,8 +10,7 @@ const LOCK_TTL_SECONDS = 55 * 60 /** * Drops `AutomationThrottle` rows whose `lastTriggeredAt` is old enough that - * they can no longer affect a live claim (retention window documented in - * `docs/plans/default-reply-throttle-hybrid.md`). These rows are cheap + * they can no longer affect a live claim. These rows are cheap * per-subject state, not an audit log, so a hard delete (no soft-delete * convention) is correct here. */ diff --git a/apps/worker/src/trigger/services/action-executor.ts b/apps/worker/src/trigger/services/action-executor.ts index 03dd4a65bf..ee2af1107b 100644 --- a/apps/worker/src/trigger/services/action-executor.ts +++ b/apps/worker/src/trigger/services/action-executor.ts @@ -18,6 +18,7 @@ import { errorStateDefaultFn, FieldOperationType, FieldReferenceKind, + metaCapiEventFieldsSchema, parseFieldReference, type SpreadsheetClearRowSchema, type SpreadsheetColumnFilterSchema, @@ -31,14 +32,21 @@ import { spreadsheetStepVersions, stepTypes, successStateDefaultFn, + withMetaCapiEventRefinements, } from "@chatbotx.io/flow-config" import baseLogger from "@chatbotx.io/logger" import { createId } from "@chatbotx.io/utils" +import { resolveContactVariablesDeep } from "@chatbotx.io/variables" import { IntegrationJobAction, integrationQueue, } from "@chatbotx.io/worker-config" import type { ExecuteStepProps } from "../../integration/handlers/flow" +import { + describeCapiInputValidationError, + enqueueCapiEvent, + reportCapiInputFailure, +} from "../../integration/handlers/meta-conversions/capi-input-error" import { clearSpreadsheetRow, getSpreadsheetRandomRow, @@ -49,6 +57,17 @@ import { import type { ActionExecutionContext } from "../types" import { resolveActionContactInbox } from "./resolve-action-contact-inbox" +// The trigger action's stored shape is validated with the same field-set +// schema the flow step and the builder trigger-action form use, +// layered with the exact same cross-field refinements the flow step's +// `sendMetaCapiEventSchema` applies (Purchase requires value+currency; the +// event name must belong to the action source's catalog) — so an invalid +// stored/edited action is caught here, before `enqueueEvent` is ever called, +// not surfaced as a business-layer `ZodError` deep inside it. +const metaCapiTriggerActionSchema = withMetaCapiEventRefinements( + metaCapiEventFieldsSchema, +) + export class ActionExecutor { async execute(context: ActionExecutionContext): Promise { const { action, contactId, triggerId, workspaceId } = context @@ -402,36 +421,59 @@ export class ActionExecutor { break } - const value = - typeof action.value === "string" ? action.value : undefined - const currency = - typeof action.currency === "string" ? action.currency : undefined - const contentCategory = - typeof action.contentCategory === "string" - ? action.contentCategory - : undefined - const contentName = - typeof action.contentName === "string" - ? action.contentName - : undefined - - await metaConversionsService.enqueueLeadEvent({ - workspaceId, - channel: capiChannel.data, - contactInboxId: contactInbox.id, - inboxId: contactInbox.inboxId, - source: "triggerAction", - sourceKey: metaConversionsService.buildLeadSourceKey({ - scope: "trigger", - scopeId: triggerId, - contactInboxId: contactInbox.id, + const parsedAction = metaCapiTriggerActionSchema.safeParse(action) + if (!parsedAction.success) { + const detail = describeCapiInputValidationError(parsedAction.error) + baseLogger.warn( + `Invalid Meta CAPI trigger action for trigger ${triggerId}: ${detail}`, + ) + await reportCapiInputFailure({ + workspaceId, + contactId, + message: `Invalid Meta CAPI trigger action (trigger ${triggerId}):\n${detail}`, + }) + break + } + + // Trigger executor passes `contactInbox.id` (a string), not the full + // model — `getContactInbox()` returns a narrow + // `ContactInboxWorkspaceRow` (id/channel/inboxId only), not a + // `ContactInboxModel`. + const resolvedFields = await resolveContactVariablesDeep( + contactId, + { + value: parsedAction.data.value, + currency: parsedAction.data.currency, + contentIds: parsedAction.data.contentIds, + }, + { contactInbox: contactInbox.id, conversation }, + ) + + await enqueueCapiEvent( + { + workspaceId, channel: capiChannel.data, - }), - value, - currency, - contentCategory, - contentName, - }) + contactInboxId: contactInbox.id, + inboxId: contactInbox.inboxId, + source: "triggerAction", + sourceKey: metaConversionsService.buildSourceKey({ + scope: "trigger", + scopeId: triggerId, + contactInboxId: contactInbox.id, + channel: capiChannel.data, + actionSource: parsedAction.data.actionSource, + }), + eventName: parsedAction.data.eventName, + actionSource: parsedAction.data.actionSource, + contentType: parsedAction.data.contentType, + contentIds: resolvedFields.contentIds, + value: resolvedFields.value, + currency: resolvedFields.currency, + contentCategory: parsedAction.data.contentCategory, + contentName: parsedAction.data.contentName, + }, + { contactId, resolved: resolvedFields }, + ) break } diff --git a/docs/ads-conversion-tracking.md b/docs/ads-conversion-tracking.md index c1485357dc..87beb0a925 100644 --- a/docs/ads-conversion-tracking.md +++ b/docs/ads-conversion-tracking.md @@ -54,12 +54,76 @@ The rule engine: ## Separate from the `sendMetaCapiEvent` / `MetaCapiEvent` pipeline -The Trigger action `sendMetaCapiEvent` and its `MetaCapiEvent` table are a -**different, unconditional** pipeline: it sends a manual `LeadSubmitted` CAPI signal -to Meta with no ad-attribution gate, and never writes `AdsConversionEvent`. Trigger -workspaces that only use `sendMetaCapiEvent` see nothing on the Ads dashboard funnel. -The two pipelines share no tables or dedup state and are intentionally kept apart; -do not merge them. +The flow step and Trigger action `sendMetaCapiEvent` — sharing one field +schema, `metaCapiEventFieldsSchema` +(`packages/flow-config/src/steps/send-meta-capi-event.ts`) — and the +`MetaCapiEvent` table (`packages/database/src/schema/meta-capi-event.ts`) are a +**different, unconditional** pipeline: it sends a configurable CAPI event to +Meta with no ad-attribution gate, and never writes `AdsConversionEvent`. +Trigger/flow workspaces that only use `sendMetaCapiEvent` see nothing on the +Ads dashboard funnel. The two pipelines share no tables or dedup state and are +intentionally kept apart; do not merge them. + +### What the step/action sends + +| Field | CAPI parameter | Notes | +|-------|-----------------|-------| +| `eventName` | `event_name` | Defaults to `LeadSubmitted`; which names are valid depends on `actionSource` (see below). | +| `actionSource` | `action_source` | Defaults to `business_messaging`; one of `business_messaging`, `email`, `phone_call`, `chat`, `physical_store`, `system_generated`, `other`. | +| `value` / `currency` | `custom_data.value` / `custom_data.currency` | Required for `Purchase`, optional for every other event; both accept a `{{variable}}` template. | +| `contentType` | `custom_data.content_type` | `product` or `product_group`. | +| `contentIds` | `custom_data.content_ids` | Comma-separated in the field, split into an array at the business boundary (`splitContentIds`); accepts a `{{variable}}` template. | +| `contentCategory` / `contentName` | `custom_data.content_category` / `custom_data.content_name` | Free text, up to 200 characters. | +| Contact identity | channel identity or `user_data` | See action-source paragraph below. | + +`eventName` is validated against one of two catalogs +(`packages/utils/src/meta-capi.ts`): `business_messaging` only offers its 14 +documented Business Messaging events (`metaCapiBusinessMessagingEventNames`, +e.g. `LeadSubmitted`, `Purchase`, `QualifiedLead`) and no custom names; every +other action source offers the 17 Meta Pixel standard events +(`metaPixelStandardEventNames`, e.g. `Lead`, `Purchase`, `Contact`) plus a +custom name up to 50 characters — a custom name can never reuse a +business-messaging event name, since that name is reserved for the other +catalog. + +`business_messaging` is the default action source and identifies the contact +by their per-channel messaging id — Messenger page-scoped id, Instagram IGSID, +or WhatsApp `wa_id` plus `ctwa_clid` +(`apps/worker/src/integration/handlers/meta-conversions/send-meta-capi-event.ts`). +The WhatsApp `ctwa_clid` gate (`skipped_no_identity`) only applies to this +action source. Picking any other action source sends a non-messaging +conversion: it loses Meta's click-to-message ad attribution entirely and +identifies the person only via hashed customer information (`em`/`ph`/`fn`/`ln`/ +`external_id`, produced by `packages/business/src/meta-conversions/hash-user-data.ts`). +`website` and `app` are intentionally not offered as action sources — Meta +requires `event_source_url` + `client_user_agent` for website events and +`app_data` for app events, none of which a messaging-driven flow/trigger step +can supply. + +### Dedup, invalid templates, and Test events + +- **Dedup / `event_id`**: `metaConversionsService.buildSourceKey` is the + `MetaCapiEvent.sourceKey` and is sent to Meta as `event_id`. Only WhatsApp + `business_messaging` events dedup per contact per UTC day (Meta caps CAPI at + one event per click-to-WhatsApp ad); every other channel / action source gets + a unique id per fire, so two Purchases on the same day are two conversions. +- **Invalid resolved templates**: a `{{variable}}` that resolves to something + the business schema rejects (e.g. `value` → `"250abc"`) is recorded in the + workspace **Error Log** (provider `meta-conversions`, with the resolved + values) and the flow step takes its error branch. This is the user's + configuration problem, so it is surfaced next to Meta-side send failures + rather than only in worker logs. +- **Test events**: each channel's CAPI tab has a *Test events* card. Saving a + Meta `test_event_code` (Events Manager → Test events) stores it on the + integration row (`capiTestEventCode`); while set, the worker sends it with + every event of that integration, so Meta shows the full payload under Test + events and does not count the events in reporting. *Send test event* queues + one sample `Purchase` (100 USD) through the real pipeline as + `MetaCapiEvent.source = "manualTest"`, attributed to the inbox's most recent + contact. Both the business layer and the worker refuse to send a + `manualTest` event without a saved code, so a test can never become a + production conversion. Meta's Test events view lists only `_eventName` and + `_valueToSum`; `content_*` parameters show up under *Sampled activities*. ## Where Ads dashboard metrics come from diff --git a/docs/multi-image-messaging.md b/docs/multi-image-messaging.md index 8b845172b6..62a404866e 100644 --- a/docs/multi-image-messaging.md +++ b/docs/multi-image-messaging.md @@ -2,8 +2,7 @@ > Research notes gathered while scoping a new "Multiple images" flow step (send several > images in one outbound message, instead of today's one-image-per-`sendImage`-step -> limit). This is **research, not a plan** — it feeds the implementation plan under -> `docs/plans/`. All channels below are now confirmed either way. +> limit). This is **research, not a plan**. All channels below are now confirmed either way. ## Current state @@ -32,8 +31,7 @@ one image per call. No channel handler currently builds a multi-item payload. 2. **Carousel** (Messenger/Instagram Generic Template `elements[]`) — horizontally swipeable cards, each **requires a `title`**. Structurally different UX and payload shape; would need its own step type if we ever want carousel-with-buttons, separate - from a plain multi-image step. (This codebase already has that step: `sendCarousel` — - see `docs/plans/` / `.plans/send-multiple-images-step.md` for how the two relate.) + from a plain multi-image step. (This codebase already has that step: `sendCarousel`.) For the "Multiple images" step being scoped, shape (1) is the target. diff --git a/docs/plans/2026-08-27-ads-timezone-migration.md b/docs/plans/2026-08-27-ads-timezone-migration.md deleted file mode 100644 index 5ca8bb3a22..0000000000 --- a/docs/plans/2026-08-27-ads-timezone-migration.md +++ /dev/null @@ -1,102 +0,0 @@ -# Ads analytics timezone migration (UTC → viewer / ad-account timezone) - -Status: **planned (separate project)** — not part of the ads dashboard filter-reuse work. -Owner: TBD · Created: 2026-08-27 - -## Problem - -The Ads analytics dashboard reports entirely in **UTC**, end to end: - -- `parseAnalyticsDateRange` (`apps/builder/src/features/ads/schema/analytics.ts`) - anchors the `from`/`to` date-keys to UTC day boundaries - (`${from}T00:00:00.000Z` … `${to}T23:59:59.999Z`). -- The ads-conversion repository buckets the timeseries day with hardcoded UTC: - `to_char(occurredAt AT TIME ZONE 'UTC', 'YYYY-MM-DD')` - (`packages/database/src/repositories/ads-conversion-event/repository.ts:995`, - and the CTWA/first-interaction variants at ~731, ~824, ~901). -- The CSV export filename + rows are documented as **byte-identical for external - consumers** (`apps/builder/src/app/space/[workspaceId]/dashboard/ads/export/route.ts`). -- The repository already flags the deeper issue in a comment (~lines 811–814): - conversions near midnight should bucket by the **ad account's reporting - timezone**, called out as a follow-up. - -The shared `DateRangePresetFilter` (reused by the Ads dashboard for UI -consistency with Contacts/Conversations) computes presets in the viewer's -**local** timezone. That local-day selection is currently written to the URL as -local date-keys and then read by the UTC pipeline — an **interim seam** that -shifts a non-UTC viewer's window by their UTC offset. See the note in -`apps/builder/src/features/ads/lib/ads-date-key.ts`. - -## Goal - -A viewer sees each calendar day's ads metrics for the intended timezone, with the -window, the day-bucketing, and the CSV export all consistent — no offset shift, -no partial end-buckets. - -## Key decision: which timezone is authoritative? - -Two candidates, and they are not the same: - -1. **Viewer browser timezone** — matches Contacts/Conversations (which thread a - `timezone` through their queries) and matches the local-oriented shared - filter. Best for in-product "what happened today for me". -2. **Ad account reporting timezone** — matches how Meta reports spend/insights; - required for spend and CTWA conversion numbers to reconcile with Meta's own - dashboards. The repository comment points here. - -These can disagree (a viewer in UTC+7 looking at a US ad account). The migration -must pick one authority per metric, or reconcile them explicitly: -- CTWA funnel conversions (our DB) → viewer timezone is defensible. -- Spend / daily insights (Meta) → ad-account timezone is effectively forced. -Mixing them per-day is the root of the "near midnight" discrepancy the code -comment describes. **This choice is the crux of the project and must be settled -first**, ideally with product + whoever owns the external CSV contract. - -## Scope / steps (once the authority is decided) - -1. Thread the chosen timezone from the request to the query layer. - - If viewer TZ: pass it from the client (URL param or a request header the - middleware forwards) — a server component cannot read the browser TZ. - - If ad-account TZ: resolve it from the connected ad account when scoping. -2. `parseAnalyticsDateRange`: build `since`/`until` at day boundaries in the - chosen timezone (date-fns-tz `fromZonedTime`), keeping the existing 366-day - cap + clamp logic on the resulting instants. -3. Repository day-bucketing: replace the hardcoded `AT TIME ZONE 'UTC'` in every - `to_char(... 'YYYY-MM-DD')` expression with the chosen timezone. Verify the - partition/index plan still holds (the 2020 TimescaleDB floor, hypertable - partitions). -4. `enumerateDateKeys` + timeseries merge: enumerate the day axis in the chosen - timezone so funnel (DB) and daily insights (Meta) align on the same day-keys. -5. Export CSV: decide whether the reporting-contract change is acceptable to - external consumers; version or gate it if not. Update the filename date label - to the chosen timezone. -6. Filter: drop the interim local-key seam — the filter's local selection now - matches the pipeline (viewer-TZ case), or convert selections to the - ad-account TZ (ad-account case). - -## Risks - -- **External CSV consumers** depend on the current byte-identical UTC output — - changing day boundaries changes which rows land in which day. -- **Metric reconciliation** with Meta's own reporting (ad-account TZ) vs. - in-product "my day" (viewer TZ) — picking wrong makes numbers "not match". -- **DST** — day length varies; use a real TZ library (date-fns-tz), never a - fixed offset. -- **Query performance** — `AT TIME ZONE` on a large scan; confirm index usage. - -## Test plan - -- Unit: `parseAnalyticsDateRange` day boundaries across DST transitions and a - negative + positive offset zone. -- Repository: bucketing places a boundary event (23:30 and 00:30 local) in the - expected day for the chosen timezone. -- Timeseries: funnel + spend day-keys align; no partial first/last bucket. -- Export: golden-file diff of the CSV under the chosen timezone; explicit - sign-off on any external-contract change. -- Cross-check a known ad account against Meta Ads Manager for the same window. - -## Interim behavior (this task) - -The Ads dashboard keeps the shared filter with local-day selection over the -still-UTC pipeline (documented seam). The Lifetime-clamp and redirect-channel -fixes shipped alongside are independent of this migration. diff --git a/docs/plans/2026-08-28-account-fields-custom-fields-page.md b/docs/plans/2026-08-28-account-fields-custom-fields-page.md deleted file mode 100644 index 3b96c6d6f1..0000000000 --- a/docs/plans/2026-08-28-account-fields-custom-fields-page.md +++ /dev/null @@ -1,317 +0,0 @@ -# Account Fields (Bot Fields) — v4 CONSOLIDATED PLAN - -Status: DRAFT — awaiting user confirmation. (v1→v3 history squashed; v3 reviewed by Codex, -all findings incorporated. This v4 adds the user's code-quality requirements as concrete -design decisions and is submitted for Codex review round 2.) - -## 1. Requirements - -1. `/space/{workspaceId}/custom-fields`: add an **Account Fields** card below the Custom - Fields card (Chatrace: "account fields"; ManyChat/Ahachat: "bot field"). Columns: - checkbox, Name, Type, Value, row-actions menu; Add button; search — per screenshot. -2. No new table; the value lives on the field row itself, NOT in `ContactCustomField`. - → Reuse the existing `BotField` table (decision confirmed with user; ManyChat splits - bot fields/user fields the same way; Chatwoot's single-definitions-table pattern does - not apply because its values never live on the definition row). -3. Chatrace parity: pickers in flow steps, trigger actions, etc. return **one combined - list** (custom fields + account fields); the **backend detects the kind and routes**. -4. Inbox and every contact-scoped surface must NOT see account fields. -5. Code-quality bar (user-mandated): modular, registry/enum-driven dispatch (no if-else - ladders), no channel hard-coding in shared files, reuse existing handlers (refine, not - duplicate), business-layer only (no direct `db` in apps), no `any`, no raw SQL string - concatenation (Drizzle parameterized only), must not break existing flows, must handle - chatbot-scale concurrency, and every case covered by tests. - -## 2. Verified current state (all claims checked against code) - -**Already exists (reuse, don't rebuild):** -- `BotField` table: `name`, `type` (shared `customFieldType` enum), `value`, `description`, - `folderId` (shares `customField` folder namespace), `workspaceId`, unique - `(workspaceId, type, name)` — `packages/database/src/schema/bot-field.ts`. In the initial - migration → **zero new migrations**. -- `botFieldService` (`packages/business/src/bot-field/service.ts`): list/find/findByKey - (id-or-name via `REGEX_BOT_FIELD_ID`)/create/updateByKey/bulkUpdateByKeys/deleteByKey, - Redis `withCache` + tag invalidation (`bot-fields:{workspaceId}:*`). -- Full CRUD UI in `apps/builder/src/features/bot-fields/` (table, dialogs, - `BotFieldValueInput`), workspace-token public API, template install support - (`template/adapters/settings.ts` creates bot fields). -- Remap engine already supports prefixed reference tokens (`fn:`/`file:`/`mcp:` in - `packages/flow-config/src/import-export/reference-fields.ts`). - -**Known defects to fix first (verified file:line):** -- `botFieldService.list()` sorts and `$count`s against `customFieldModel` instead of - `botFieldModel` (service.ts:62,70) → wrong pageCount. -- `UpdateBotFieldDialog` does not bind/render `value` - (`update-bot-field-dialog.tsx:~74–78`, commented out) → Value not editable. -- `botFieldService.deleteByKey` **deletes the row** (service.ts:226→bulkDelete:254); - there is no clear-value API. -- No value-operation semantics exist anywhere (append/prepend/increase/decrease). - Pre-existing platform bug (OUT of this feature's scope unless user opts in): - flow `setCustomField` handler drops `step.operation` - (`apps/worker/src/integration/handlers/contact.ts:61`) and trigger `ActionExecutor` - silently no-ops O02–O05 (`action-executor.ts:151–155`). -- The page `/space/:id/bot-fields` is an orphan route (no tab/menu links to it). - -**Write-path reality (Codex-verified):** the four `contactCustomFieldService` entry points -(`setValueByKey`, `setValues`, `deleteByKey`, `deleteByCustomFieldId`) are the final write -chokepoints, BUT several step handlers read/validate `customFieldModel` / -`contactCustomFieldModel` directly BEFORE writing (tool-handler `countCharacters:49`, -`formatDate:91`, `getDataFromJSON:165`; `javascript-execution/service.ts:43` preflight). -Chokepoint routing alone therefore covers only steps without preflight reads. - -## 3. Core design - -### 3.1 Field reference model (shared, channel-agnostic) - -New module `packages/flow-config/src/field-reference.ts` (pure, no channel logic): - -```ts -export const FieldReferenceKind = { customField: "customField", botField: "botField" } as const -export type FieldReferenceKind = (typeof FieldReferenceKind)[keyof typeof FieldReferenceKind] - -export const BOT_FIELD_REFERENCE_PREFIX = "bot_field" // token form: bot_field: - -export type FieldReference = - | { kind: typeof FieldReferenceKind.customField; key: string } // id or name (legacy behavior) - | { kind: typeof FieldReferenceKind.botField; id: string } - -export const parseFieldReference = (raw: string): FieldReference -export const formatBotFieldReference = (id: string): string // `bot_field:${id}` -// NOT a digits-only regex: legacy flows store field NAMES in inputFieldId (any non-empty -// string; contactCustomFieldService also resolves by name). Widening must keep every -// stored value valid while banning only a malformed reserved prefix: -export const zodFieldReference = () => - z.string().trim().min(1) - .refine((v) => !v.startsWith(`${BOT_FIELD_REFERENCE_PREFIX}:`) || - new RegExp(`^${BOT_FIELD_REFERENCE_PREFIX}:\\d+$`).test(v)) -``` - -- Discriminated union + exhaustive `switch` (compiler-checked), no `any`, no if-else chains. -- Why prefix, not raw id: the remap engine classifies scalar reference slots **by key name** - (`inputFieldId` → `"customField"`); a raw bot-field id would be remapped against the wrong - idMap on template install/flow import and silently break. `bot_field:` follows the existing - `fn:`/`file:`/`mcp:` precedent. - -### 3.2 Business-layer routing (registry, not if-else; refine existing functions) - -- `botFieldService` gains (Phase 0): - - `applyValueOperation({ workspaceId, id, operation, value })` — operation dispatch via a - handler map `Record` (registry per user - requirement, mirrors `FieldOperationType` enum). Temporal normalization reuses - `resolveTemporalCustomFieldSaveFormat` utilities — no duplicate logic. - - `clearValueByKey` — `value = null` (row deletion remains a separate admin API). - - **Concurrency (chatbot-scale)**: `increase`/`decrease`/`append`/`prepend` run as a single - atomic Drizzle UPDATE expression (parameterized `sql` operators — no read-modify-write - race across worker replicas, no raw string SQL → no injection). -- Routing placement (revised twice after caller audits — final): **capability is opt-in per - caller, never ambient**. `setValueByKey` / `deleteByKey` gain an options field - `allowBotFields?: boolean` (default **false**). Only when true is `parseFieldReference` - consulted; botField branch delegates to `botFieldService`; customField branch is the - EXISTING code path untouched (refine, don't fork — old flows keep byte-identical - behavior). With the default, a `bot_field:` token falls through to the legacy name-lookup - and fails with the existing notFound error. -- Why opt-in even at the keyword chokepoints: the PUBLIC workspace-token API - `DELETE /v1/contacts/{identifier}/custom-fields/{idOrName}` - (`contacts/api/workspace-token.ts:322,341`) and the rich-response action executor - (`rich-response/action-executor.ts:99,115`) pass arbitrary strings into - `setValueByKey`/`deleteByKey`. Ambient prefix parsing would let a contact-only public - endpoint mutate Account Fields. Default-false makes contact-purity structural. -- v1 callers passing `allowBotFields: true` (exactly four): flow set step, flow clear step - (`handlers/contact.ts:61,82`), Get User Data (`get-user-data.ts:146,269` — verified: no - customFieldModel preflight). -- **Do NOT touch the id-based `setValues` / `deleteByCustomFieldId`**: 20+ contact-scoped - callers (minigame, questionnaire, WhatsApp-Flow response, dynamic-image, AI tools, - spreadsheet, contact actions, workspace-token bulk API). They stay contact-pure. -- Trigger `ActionExecutor` (the only v1 surface feeding raw UI-chosen references into - `setValues`/`deleteByCustomFieldId`): dispatch via `parseFieldReference` AT the executor — - botField branch → `botFieldService.applyValueOperation`/`clearValueByKey`, customField - branch → existing calls unchanged. -- **Operation × type policy** (registry enforces; invalid combos raise the existing - exception type): `set` — all types; `append`/`prepend` — text only; `increase`/ - `decrease` — number only; boolean/date/datetime accept only `set` (temporal - normalization runs BEFORE the update, reusing existing datetime utilities). Atomic - parameterized Drizzle `sql` UPDATE (`concat`/`coalesce` for append/prepend, numeric cast - for inc/dec) with `WHERE workspaceId AND id`, `.returning()`, then tag invalidation; - a historical non-numeric value under inc/dec fails predictably (tested). -- No `apps/` code touches `db`; everything stays behind `@chatbotx.io/business`. - -### 3.3 Combined picker (UI), opt-in allowlist - -- `useCustomFieldSelectOptions` / `CustomFieldSelect` / `CustomFieldField`: new - `includeBotFields?: boolean` (default **false**). When true, return **grouped options** - using the existing native mechanism — `SelectOption.children` renders as a - `CommandGroup` with a heading in `ComboboxField` (combobox-field.tsx:190-203; precedent: - `useFlowNodesSelectOptions`, `MultiSelectGroup`). Group order: "System Fields" (when - `includeReserved`) → "Custom Fields" → "Account Fields" (values = - `formatBotFieldReference(id)`). Search spans groups (ComboboxField flattens for lookup). - Constraint: `SelectField` does NOT render `children` (it flattens groups), so grouped - output is emitted ONLY on the `includeBotFields` path — every v1 surface renders via - `ComboboxField`; the ~24 existing flat-list consumers keep their current shape untouched. - Group headings via `useTranslations()` (i18n keys, all locales). -- Store: extend the existing custom-field zustand store with `botFields` — **lazy-loaded** - (`ensureBotFieldsLoaded()` invoked from the options hook only when `includeBotFields` is - true), with its own `botFieldsLoading`/`botFieldsError` state and in-flight dedupe so - multiple pickers on one page trigger one fetch. `initialize()` stays custom-fields-only: - `CustomFieldStoreProvider` is mounted on ~20 pages including inbox - (custom-field-store-context.tsx:40, inbox/page.tsx:44); eager fetching would add a wasted - request per page view at chatbot scale. -- Field-type lookup (operation options, temporal hints) resolves through one helper - `findFieldByReference(reference, { customFields, botFields })` — shared, tested. -- Allowlist v1 (everything else stays default-off): flow steps `set-custom-field`, - `clear-custom-field`, `get-user-data`; trigger actions `setCustomField`, - `clearCustomField`. - -### 3.4 Export / import / template install (full spec) - -- `reference-fields.ts`: register `bot_field → "botField"` in - `PREFIXED_REFERENCE_ENTITY_KIND`; scalar-slot value dispatch — in `remapEntry` - (`remap.ts:219`) the scalar resolver must recognize a valid `bot_field:` token **before** - the generic customField remap (ordering matters: today the scalar `customField` path runs - first and would swallow the token), resolve against `idMaps.botField`, re-serialize with - the prefix (helper shared by walkers). -- `references.ts`: `collectCustomFieldReferences` currently returns `string[]` of numeric - ids only (references.ts:62,90) — replace with a typed collector returning - `{ customFieldIds: string[]; botFieldIds: string[] }` (keep the old export as a thin - wrapper if external callers exist; grep first). -- Flow export route (`flows/[id]/export/route.ts:75`): stop assuming all collected ids are - custom fields; emit a `botFields` manifest (name/type keyed like custom fields). - `flowExportSchema.botFields` uses `.default({})` so OLD exports without the key still - parse; a token with no manifest entry stays untouched + warning (no format-version bump). -- Flow import worker (`flow-import.ts`) + `FlowService.importFlowExport`: resolve-or-create - bot fields by `(name, type)` (mirror `customFieldService.resolveByNameAndType` policy), - build `idMaps.botField`, remap, invalidate, warn on misses. -- **Template snapshot dependency ordering** (Codex r2): `settingsAdapter` currently has - `providesKinds: []` and only `ctx.track()`s created bot fields (settings.ts:37,73) — - it must declare `providesKinds: ["botField"]` AND populate `ctx.idMaps.botField` - (sourceId → createdId) at creation. `flowsAdapter` must consume `"botField"` and the flow - exporter's `collect()` must return the exact `TemplateHardDependency` shape - (`adapters/types.ts:63`): `hardDependencies: dedupe(botFieldIds).map((sourceId) => - ({ category: "settings", sourceId }))` — a flows-only snapshot then pulls its referenced - bot fields in and installs in dependency order. -- Tests: round-trip export→import same workspace / cross workspace / old export without - `botFields` key; snapshot flows-only, settings+flows, install ordering + idMap. - -### 3.5 What stays contact-only (negative guarantees) - -Inbox contact panel, contact filter/segments/audiences, contact import/export mapping, -CRM sync (ActiveCampaign/Mailchimp/Drip/GetResponse/Klaviyo), lead-ads mapping, -questionnaire/WhatsApp-Flow response mapping (`whatsapp-flow-response/service.ts` hard -contact semantics), minigames, dynamic images, condition step, CustomFieldValueChanged / -DateTime triggers. Each keeps `includeBotFields` unset AND gets a negative test where a -`bot_field:*` token must be rejected (`zodFieldReference` not applied there; existing -digit-only schemas keep rejecting it — a structural guarantee, not just convention). - -## 4. Phases - -### Phase 0 — Fix pre-existing bot-field defects (blockers) -1. `botFieldService.list`: use `botFieldModel` for orderBy + `$count` (+ regression test). -2. `UpdateBotFieldDialog`: bind `value` via `BotFieldValueInput`. -3. Add `applyValueOperation` (registry dispatch, atomic UPDATE) + `clearValueByKey` - (+ unit tests: 5 operations × text/number/temporal, concurrent increase test). - -### Phase 1 — Account Fields card on `/custom-fields` -1. RSC wrapper `listBotFieldsRSC` (auth via `assertCurrentUserCanAccessChatbot`), fetch-all - with documented hard cap (500) — `useDataTable` hard-codes `page`/`perPage`/`sort` URL - keys, so the second table must be client-driven to avoid param collision. -2. `AccountFieldsCard` client component (client-side search/pagination via React state), - reusing existing dialogs + `CustomFieldTypeLabel`. Columns per screenshot. -3. i18n `accountFields.*` keys in ALL locale files (title "Account Fields"). -4. Delete orphan route `/space/[workspaceId]/(has-folder)/bot-fields/` (pending user OK). - -### Phase 2 — Private API + store -1. `features/bot-fields/api/private.ts`: `GET /workspaces/{workspaceId}/bot-fields` - (`authorizedAPI` + `workspaceAuthorizedMidddleware` — triple-d), mirroring - custom-fields `private.ts`; register in `routers/index.ts`. -2. Store: add `botFields` + fetch; expose through `CustomFieldStoreProvider` (no new - provider — refine existing). - -### Phase 3 — Field reference module + picker -1. `field-reference.ts` in flow-config (3.1) + unit tests (parse/format/zod edge cases: - empty, `bot_field:`, `bot_field:abc`, plain name, numeric id). - Reserved-name guard + rollout audit: field `name` schemas currently accept any 1–255 - chars — a field literally named `bot_field:123` would collide with reference tokens. - (a) Add a refine to the create/update `name` schemas of BOTH custom fields and bot - fields rejecting names starting with the reserved prefix. (b) **Rollout audit step - (before enabling the feature)**: one-off read-only check that no existing - `CustomField.name`/`BotField.name` starts with `bot_field:` and no stored flow version / - trigger action holds a reference value starting with `bot_field:` that is not a valid - token (expected result: zero rows; if any exist, rename via the normal update API before - rollout). Only after (a)+(b) may the widening be called backward-compatible — the claim - is verified, not assumed. -2. Picker opt-in + "Account Fields" group + `findFieldByReference` helper. -3. Widen `set-custom-field.ts` / `clear-custom-field.ts` trigger schemas and flow-config - step schemas to `zodFieldReference()` (backward compatible — all stored values still - validate; verify no other consumer of those exact schema objects narrows on digits). - -### Phase 4 — Backend routing (v1 write surfaces) -1. `setValueByKey`/`deleteByKey`: add `allowBotFields` opt-in routing per 3.2. - `SetValueByKeyInput` additionally gains an optional `operation?: FieldOperationType` — - consumed ONLY by the bot branch in v1 (contact branch ignores it, preserving today's - set-only behavior byte-for-byte; the contact operation no-op is a pre-existing bug, - separate PR). `applyValueOperation` accepts the temporal options - (`sourceTimezoneOverride`, lenient parsing, fill-now) so date/datetime bot fields anchor - to the step-frozen timezone. -2. Worker handler changes (explicit — NOT "unchanged"): - - `handlers/contact.ts` — SET step handler: pass `allowBotFields: true`, - `operation: step.operation`, and the existing timezone/temporal options through - (variable resolution stays where it is). CLEAR step handler: pass - `allowBotFields: true` ONLY — clear has no operation/temporal semantics; it routes to - `clearValueByKey` and nulls the value. - - `get-user-data.ts` (2 call sites): pass `allowBotFields: true` only. - - Trigger `ActionExecutor` set/clear cases: dispatch via `parseFieldReference` — bot - branch → `botFieldService.applyValueOperation` / `clearValueByKey`; custom branch - keeps today's `setValues` / `deleteByCustomFieldId` calls unchanged. - - Untouched (stay `allowBotFields` default-false, with negative tests): booking - `submit-booking.action.ts:64`, `appointment-scheduling.ts:348,564`, - `lead-ads/index.ts:78`, `rich-response/action-executor.ts:99,115`, and the - workspace-token contact endpoints — the PUT/bulk setter (`workspace-token.ts:315`, - via `setValues`) and DELETE (`workspace-token.ts:341`, via `deleteByKey`); GET stays - in the negative suite as the read-only case. -3. Tests (`apps/worker/__tests__`, `packages/business/__tests__`): prefix routed to - BotField (value updated, no `ContactCustomField` row created); SET path — operation + - timezone forwarded end-to-end (builder save → trigger/flow execution); CLEAR path — - routing only, asserts value nulled (no operation/temporal args); plain id/name - unchanged; unknown bot-field id → existing notFound error (job-safe); clear sets null - not delete; cache invalidation tags fire. - -### Phase 5 — v2 (explicitly deferred, listed for completeness) -- Output-field slots of ~20 utility/AI steps (extract-data, speech-to-text, format-date, - external-request, execute-js, get-data-from-json, generate-code, count-characters, - ai-generate-*, AI Functions): each needs a read/validate adapter because they preflight - `customFieldModel`/`contactCustomFieldModel` directly. Rollout = flip `includeBotFields` - per step ONLY after its adapter lands. -- `{{bot_field.}}` read interpolation in `contactVariableService` - (`packages/variables/src/contact-variable.ts`): requires explicit namespace + precedence - policy (name-keyed merge would be insertion-order dependent) + TipTap options update. -- Condition step / field-based triggers reading bot-field values. -- Fixing the pre-existing contact-field operation no-op bug (separate PR if user wants). - -### Phase 6 — Quality gate -- `pnpm lint`, `pnpm --filter builder check-types`, `pnpm --filter worker check-types`, - business/flow-config typechecks; `invariant-guard` pass; negative-surface test suite - (3.5); round-trip export/import tests (3.4). - -## 5. Test matrix (all cases) - -| Area | Cases | -|---|---| -| field-reference | parse: numeric id, legacy NAME, `bot_field:`, malformed (`bot_field:`, `bot_field:x`, empty); format; zod: legacy names still accepted, malformed reserved prefix rejected | -| botFieldService | list count fix; find by id/name; operation×type policy matrix (valid + every invalid combo errors); concurrent increase AND append/prepend (atomicity); non-numeric historical value under inc/dec fails predictably; clearValueByKey null-not-delete; **stale-read**: cached `find`/`findByKey` re-read fresh after update/clear (both id- and key-cache entries) | -| routing | setValueByKey/deleteByKey × {allowBotFields true/false} × {legacy key, bot token, unknown}; default-false: bot token → notFound, no BotField mutation; no ContactCustomField row and no customFieldChanged event for bot path | -| worker handlers | set/clear step + trigger set/clear + get-user-data with bot ref; variable tokens in value still resolved; legacy behavior byte-identical | -| public API (negative) | workspace-token contact GET/PUT/DELETE custom-field endpoints must NOT read or mutate bot fields with a `bot_field:` token | -| export/import/template | typed collector; round-trip remap (same ws, cross ws, old export without botFields key, missing manifest warning); scalar-before-generic ordering; snapshot flows-only + settings+flows + install ordering populate idMaps.botField | -| UI | AccountFieldsCard render/search/edit-value/delete; picker grouping; lazy store fetch + dedupe; folder move preserves id/value and flow tokens; negative: inbox + contact filter + import/export offer no bot fields | -| schemas | widened trigger/step schemas accept legacy names + bot tokens; contact-only schemas still reject `bot_field:*` | - -## 6. Risks - -- HIGH (mitigated): template/flow import remap of `bot_field:` tokens — full spec 3.4 + tests. -- MEDIUM: schema widening shared-object blast radius — audit every consumer of the widened - zod objects before merging. -- MEDIUM: operation semantics on temporal/number values — registry handlers + error paths - tested; unknown/invalid input surfaces the existing exception type (job retry-safe). -- LOW: two-table URL param collision — avoided by client-driven card (verified hook keys). -- LOW: i18n completeness across locales. - -## 7. Estimated complexity: MEDIUM-HIGH (~1.5–2 days incl. tests) diff --git a/docs/plans/2026-08-28-custom-field-value-normalization.md b/docs/plans/2026-08-28-custom-field-value-normalization.md deleted file mode 100644 index 5c2c8ceed4..0000000000 --- a/docs/plans/2026-08-28-custom-field-value-normalization.md +++ /dev/null @@ -1,148 +0,0 @@ -# Custom/Bot field value normalization — store canonical, filter correct - -Status: DRAFT — awaiting user confirmation. - -## Problem (verified) - -- `normalizeCustomFieldValueForStorage` (`packages/business/src/contact-custom-field/normalize.ts`) - normalizes ONLY `date`/`datetime`. `number`/`boolean`/text pass through raw — any write - path that is not a typed UI input (flow Set Custom Field free-text value with - `{{variables}}`, trigger actions, AI extract/tools, public APIs, imports, JS execution) - can store garbage: real examples `number = "1aaa1"`, `boolean = "12313"`. -- Contact filter (`packages/database/src/queries/contact-filter/custom-field-predicates.ts`): - `number` and `datetime` are guarded + cast (garbage rows silently never match), but - `boolean` has NO branch — it falls into plain TEXT equality, so stored `"TRUE"`, `"1"`, - `"0"` never match the UI's `eq "true"/"false"` condition. -- Bot fields reuse the same normalize util → same gap (screenshot evidence). Bot fields do - NOT participate in contact filter — their fix is storage-side + display only. - -## Design principle - -One canonical form per `CustomFieldType`, enforced at the WRITE chokepoints of BOTH -systems (single registry, no per-caller logic), plus a defensive read-side boolean -predicate so legacy rows filter correctly without waiting for backfill. - -### Canonical storage forms - -| Type | Canonical stored value | Coercion on write | -|---|---|---| -| boolean | `"true"` / `"false"` | trim+lowercase; sets follow **Postgres boolean literal semantics** (Chatwoot casts `::boolean` in SQL, which accepts exactly these): TRUTHY `{t, true, y, yes, on, 1}`, FALSY `{f, false, n, no, off, 0}`; `""` → `"false"` (per user: `0/false/rỗng/FALSE → false`); unrecognized non-empty → `"true"` (never throws — chatbot flows must not crash on user text; Chatwoot would raise a cast error here, we deliberately don't) | -| number | canonical decimal string via `Number()` (`"007"`→`"7"`, `" 1.50 "`→`"1.5"`) | trim; `""` stays `""` (unset); non-parseable (NaN/∞) → throw typed `ChatbotXException` (predictable, no silent data loss) — same failure surface as temporal Strict today | -| date / datetime | (already done) ISO via existing temporal normalization | unchanged | -| shortText / longText | trimmed as-is | unchanged (zod already trims) | -| email / phoneNumber | trimmed; email additionally lowercased? — **user decision** (default: trim only, no behavior change) | - -Implementation: extend `normalizeCustomFieldValueForStorage` with a -`Record` registry (async only for temporal; others pure). -Single source of truth; exported pure helpers (`normalizeBooleanValue`, -`normalizeNumberValue`) unit-testable without DB. - -## Phases - -### Phase 1 — ONE unified normalizer registry (Codex r1: a second normalizer already exists) -- **Discovery**: `packages/business/src/javascript-execution/custom-field-value.ts` already - normalizes/validates per type (strict boolean `true/false/1/0`, own number regex, email - lowercase) and is used by CONTACT IMPORT. Two independent normalizers must not drift. -- Unify: shared literal sets + pure per-type normalizers live in - `@chatbotx.io/utils/custom-field` (NEXT TO the `CustomFieldType` enum — utils is the - dependency floor: flow-config and database cannot import business). Two POLICY modes: - - `coerce` (runtime writes: flows, triggers, APIs, dialogs) — table above, never throws - on boolean, throws typed error on bad number. - - `strict` (import) — invalid → skip the field (import's existing behavior), but the - ACCEPTED literal sets are the same shared constants (import's boolean set widens from - `true/false/1/0` to the full PG-literal set — deliberate, documented change). -- `normalize.ts` (business) and `custom-field-value.ts` both delegate to the shared - registry; neither keeps a private copy. -- Unit tests: full matrix per type × mode (booleans: `0/1/true/TRUE/False/yes/no/on/off/ - ""/"12313"/" TRUE "`; numbers: `"7"/"007"/" 1.5 "/"1e3"/""/"1aaa1"/"-2.5"/Infinity`; - text passthrough). - -### Phase 2 — Enforce at EVERY write path (audited list, not an assumption) -Contact fields (`ContactCustomField.value`): -1. `contactCustomFieldService.setValues` / `setValuesInTransaction` core — covers the - 20+ service callers incl. `setValueByKey` (verified: it funnels into `setValues`; one - normalization point, idempotent). -2. `insertNormalizedValuesForNewContacts` (bulk import fast-path that bypasses - `writeValues`) — switch to the shared registry in `strict` mode. -3. `apps/worker/src/integration/handlers/ref.ts` — writes `contactCustomFieldModel` - DIRECTLY (also a data-access-rule violation): refactor to go through the service - (normalization then applies automatically). -Bot fields (`BotField.value`): -4. One private `prepareValuePatch(type, value)` inside `botFieldService`, called by - `create`, `updateByKey` (covers builder dialogs AND the workspace-token set-one/set-many - APIs which call `updateByKey` directly), and `bulkUpdateByKeys` (make it delegate to the - same primitive instead of its own write). `applyValueOperation` set path already calls - the normalizer — switches to the shared registry. -5. Template install `settings.ts` bot-field `create` with `value` → covered by (4). - (`resolveByNameAndType` creates definitions only, no value — verified, nothing to do.) -- Operations: `increase`/`decrease` operand goes through the shared number normalizer - BEFORE the atomic SQL (typed error instead of a PG cast error); `append`/`prepend` - text-only (unchanged). -- Regression guarantee: temporal behavior byte-identical; **text types stay RAW — - no trim** (trimming at storage would change flow/tool/API behavior for callers that - bypass zod; explicitly out of scope). - -### Phase 3 — Filter correctness (read side, defensive for legacy rows) -- `custom-field-predicates.ts`: add a dedicated `boolean` branch mirroring the file's OWN - existing number pattern (guard + `NULLIF(...)::cast`), whitespace-tolerant for legacy - rows: guard on `lower(btrim(value)) ~ '^(t|true|y|yes|on|1|f|false|n|no|off|0)$'` then - compare `NULLIF(lower(btrim(value)),'')::boolean = ` (so legacy `" TRUE "` - matches). Chatwoot casts `::boolean` unguarded and ERRORS on garbage; we keep the repo's - guarded philosophy so garbage rows silently don't match. The regex source derives from - the shared literal arrays in `@chatbotx.io/utils/custom-field` (same source as the JS - normalizers) so write & read can never drift. UI already sends exactly `"true"/"false"` - (verified: contact-filter-condition-dialog.tsx:234). `isEmpty`/`isNotEmpty` unchanged - (they treat only `''` as empty — preserved). -- Number/datetime branches already guarded — no change; add regression tests pinning the - guard behavior for garbage values. -- Tests in `packages/database/__tests__/contact-filter.test.ts` style: legacy variants - (`"TRUE"`, `"1"`, `"0"`, `"FALSE"`, `""`, garbage `"12313"`) × eq true/false. - -### Phase 4 — Display polish (Account Fields card + contact panel) -- Value column: boolean shows localized True/False label; date/datetime formatted for - display (workspace zone) instead of raw ISO. Display-only — stored value untouched. - -### Phase 5 — Legacy data backfill (one-off script, index-aware) -- `scripts/normalize-field-values.mts`: dry-run by default, `--fix` applies the shared - registry normalizers (boolean coercion; number: non-parseable left untouched + reported - — never destroys data). -- Query strategy (`ContactCustomField` has NO `workspaceId`; indexes are unique - `(contactId, customFieldId)` and `(customFieldId, id)`): enumerate boolean/number - `CustomField` definitions first, then **keyset-paginate `ContactCustomField` on - `(customFieldId, id)`** — never offset-scan or full-table update. `BotField` is small; - scan per workspace. -- Cache: no per-contact invalidation from a bulk script — do an explicit Redis - prefix purge of the contact-custom-field cache tags after `--fix` (or document - accepting the TTL window); state which in the script header. - -### Phase 6 — Quality gate -- `pnpm lint`, check-types (database, business, builder, worker), full test suites, - Fable + Codex review rounds per the established workflow. - -## Decision points (need user answer) -1. **Boolean coercion**: generous (recommended — falsy set else true, never throws) vs - strict allowlist (reject `"12313"`)? -2. **Number invalid input**: throw typed error (recommended) vs store `""` silently? -3. **Email lowercase on write**: yes/no (default no — avoids changing existing data - semantics)? -4. Run Phase 5 `--fix` on production after review, or report-only first? - -## Observable-behavior changes (read paths — regression tests required) -Canonicalization changes what downstream READERS see, not just storage: -- JS execution coerces boolean via `value === "true"` - (`packages/variables/src/javascript-interpolation.ts:392`) — legacy `"TRUE"/"1"/"yes"` - flip from false→true after normalization (this is the BUG FIX, but pin it with tests). -- `{{field}}` / `{{raw:field}}` interpolation, webhook payloads, tool params, CSV export, - spreadsheet write, integration field-maps will emit canonical `"true"/"false"` — - regression tests for each in the matrix. - -## Risks -- MEDIUM: import boolean set widens from `true/false/1/0` to full PG literals — rows that - previously skipped the field now import a value; documented, tested. -- MEDIUM: boolean semantics change for flows comparing raw text (see observable list) — - changelog note. -- LOW: double-normalization — single point per system + idempotent normalizers (tested). -- LOW: JS/SQL literal-set drift — one shared constant in `@chatbotx.io/utils/custom-field` - + a test asserting the SQL guard regex and JS sets agree on the full matrix. - -## Estimated complexity: MEDIUM (~0.5–1 day incl. tests) diff --git a/docs/plans/2026-09-03-sequence-step-delay-unit-persistence.md b/docs/plans/2026-09-03-sequence-step-delay-unit-persistence.md deleted file mode 100644 index 92b869ddfd..0000000000 --- a/docs/plans/2026-09-03-sequence-step-delay-unit-persistence.md +++ /dev/null @@ -1,344 +0,0 @@ -# Sequence step delay — unit change not persisted after reload - -Status: IMPLEMENTED on branch fix/sequence-step-delay-unit-persistence (5 commits, reviewed by Claude + Codex, browser-verified). - -## Reported bug - -Sequence editor (`apps/builder/src/features/sequences/`). A step shows "After 2 Hours". -User switches the unit select Hours → Minutes WITHOUT editing the number. After F5 the -UI shows "2 Hours" again. - -## Root cause (verified by Claude + Codex independent review) - -Stored columns: `delayDays`, `delayMinutes` (scheduler source of truth, additive) and -`delayUnit` (display only, plus the `specificTime` discriminator). The UI has two places -that "guess" instead of trusting stored data, and they disagree: - -1. `sequence-step-card.tsx:80-81` passes `currentDelayValue = step.delayDays || step.delayMinutes || 1` - to `useSequenceStep` — the RAW stored minutes (120), not the displayed value (2). - `use-delay-state.ts` `handleDelayUnitChange` calls `onSave({ delayUnit })` with no value, - so `use-sequence-step.ts:142` falls back to 120 → saves `delayMinutes=120, delayUnit="minutes"`. -2. `use-delay-state.ts` `getInitialDelayUnit/getInitialDelayValue` ignore stored `delayUnit` - for minutes/hours/days and infer from magnitude (`delayMinutes >= 60` → hours). On reload, - 120 minutes displays as "2 Hours" regardless of stored unit. 90 minutes displays as - "1 Hours" (`Math.floor`, lossy). `immediate`/`specificTime` DO honor the stored unit. - -Combined: the save is wrong (bug 1) and even a correct save would display wrong (bug 2). - -## All defects found in this flow - -| # | File | Defect | Impact | -|---|------|--------|--------| -| 1 | `components/sequence-step-card.tsx:80-81` | Raw stored value used as "current" display value | Unit-only change double-converts. Hours→Days writes `delayDays=120` → **real scheduling corruption** (scheduler = `delayDays*1440 + delayMinutes`) | -| 2 | `hooks/use-delay-state.ts:25-49` | Unit/value inferred from magnitude, stored `delayUnit` ignored | 120 min stored as minutes shows "2 Hours"; 90 min shows "1 Hours" | -| 3 | `hooks/use-sequence-step.ts:94` | `isSavingRef` guard silently DROPS a second save while one is in flight (no toast) | Focused number input → mousedown on Select → blur save #1 → unit pick save #2 dropped. Same guard affects `useTimeRangeState` (send-window controls, which are not even passed `isSaving`) | -| 4 | `components/delay-selector.tsx:50` | `localValue = useState(delayValue)` never re-syncs | Stale number after parent updates | -| 5 | `hooks/use-delay-state.ts:110` + `use-sequence-step.ts:98` | Editing an already-chosen specific date sends only `{ specificDateTime }`; "must be in the future" validation requires `delayUnit === "specificTime"` in the same payload | Validation runs only on first pick, bypassed on edit | -| 6 | `hooks/use-sequence-step.ts:138`, `schema/action.ts` | Leaving `specificTime` never clears `specificDateTime`; schema `z.iso.datetime().optional()` cannot accept `null` | Stale date reused on a later switch back. Scheduler safe (checks `delayUnit === "specificTime"`) | -| 7 | `schema/action.ts:63` | No cross-field validation: `delayUnit="days"` + `delayMinutes=120` accepted | Allows contradictory rows (how this bug persisted data) | -| 8 | `hooks/use-delay-state.ts:74` | Hook state initialized once; not reset after `router.refresh()` | If a save fails, UI keeps new value while DB has old | - -Out of scope (file separate issues): - -- `apps/worker/src/integration/handlers/contact.ts:399-410` — flow "subscribe to sequence" - path computes first-step `nextRunAt` from `delayDays/delayMinutes` only, ignoring a - first step configured as `specificTime`. -- `sequence-editor.tsx:148` never passes `previousStepTime`, so cross-step ordering - validation in `handleSave` is dead code. -- `sequence-editor.tsx` `steps` prop type omits `delayUnit`, `specificDateTime`, `isActive`, - send-window fields; runtime values arrive from `getSequence`. Type-only gap. - -## Backward-compat audit (why this will not break existing flows) - -| Surface | Consumers | Impact | -|---------|-----------|--------| -| `upsertSequenceStepRequest` / `upsertSequenceStepAction` | Only `sequence-editor.tsx` (Add button), `use-sequence-step.ts`, and `__tests__/upsert-sequence-step.action.test.ts` | No public API / SDK / MCP / CLI consumer. Cross-field validation cannot affect external clients | -| `useSequenceStep`, `useDelayState`, `DelaySelector` | Only `sequence-step-card.tsx` | Removing `currentDelayUnit/currentDelayValue` props is safe | -| Flow "Wait" step `DelayUnit` (`features/flows/.../wait/`) | Own type, own component | Untouched | -| `packages/sequence-scheduler`, `packages/business/contact-sequence`, worker | Read `delayDays + delayMinutes`; read `delayUnit` only for `=== "specificTime"` | No change. Writing `specificDateTime = null` for relative units is invisible to them | -| DB `delayUnit` column | Nullable since initial migration, no backfill; action always sets it on create | Null rows only possible from seed/external writers; display fallback handles them | -| Dev DB (scanned read-only) | 7 rows: minutes×5, immediate×1, days×1; zero inconsistent, zero null | No surprise display changes locally. The row the user already changed is stored as 120 minutes and will correctly show "120 Minutes" | -| Existing action tests | Mock the whole safe-action chain; schema is not exercised; update tests send single delay fields (e.g. only `delayDays: 3`) | Will not break, PROVIDED the new cross-field refine only runs when `delayUnit`, `delayDays`, `delayMinutes` are ALL present | - -Three guard rails adopted from the audit: - -1. Schema cross-field validation triggers only when the full delay triple is present. - Partial payloads (legacy shape) still pass. The Add button already sends `days/1/0`. -2. `handleSave`'s public signature is unchanged so `useTimeRangeState`, `handleSelectFlow`, - `handleActiveChange` need no edits. -3. Controls stay `disabled` while saving exactly as today. The queue only guarantees the - second action is not lost; no visible UX change. - -## Design - -### Pure helpers — `apps/builder/src/features/sequences/lib/delay.ts` - -```ts -type DelayUnit = "immediate" | "minutes" | "hours" | "days" | "specificTime" -type DelayView = { unit: DelayUnit; value: number; specificDateTime: string } -type StoredDelay = { delayDays: number; delayMinutes: number; delayUnit: DelayUnit; specificDateTime: string | null } - -stepToDelayView(step): DelayView -delayViewToStored(unit, value, specificDateTimeIso?): StoredDelay -``` - -`stepToDelayView` rules — trust the stored unit ONLY when the numeric columns satisfy it -exactly; otherwise (or when `delayUnit` is null) fall back to the most precise unit: - -| Stored unit | Accepted iff | Fallback | -|---|---|---| -| `specificTime` | `specificDateTime` non-null | inference below | -| `immediate` | days = 0 and minutes = 0 | inference | -| `days` | minutes = 0 (days ≥ 0) | inference | -| `hours` | days = 0 and minutes % 60 = 0 | inference | -| `minutes` | days = 0 | inference | -| null / other | — | inference | - -Inference: days > 0 && minutes = 0 → days; days > 0 && minutes > 0 → minutes (days*1440+minutes); -minutes % 60 = 0 && minutes > 0 → hours; minutes > 0 → minutes; both 0 → immediate. -Never truncate (90 minutes is "90 Minutes", never "1 Hours"). - -`delayViewToStored`: days → `{value,0}`; hours → `{0,value*60}`; minutes → `{0,value}`; -immediate → `{0,0}`; specificTime → `{0,0, specificDateTime: iso}`. Every relative/immediate -result carries `specificDateTime: null`. - -### Save flow - -- `use-delay-state.ts`: unit change and value change BOTH send `{ delayUnit, delayValue }` - from the currently displayed state. Specific-date edits always send - `{ delayUnit: "specificTime", specificDateTime }` so validation runs every time. -- `use-sequence-step.ts`: drop `currentDelayUnit/currentDelayValue` props. Build the delay - part of the payload with `delayViewToStored`. Replace the `isSavingRef` early-return with - a FIFO promise chain (`queueRef = queueRef.then(run)`); each queued item's payload is - fully computed at enqueue time (no stale closure). `isSaving` stays true until the chain - drains; `router.refresh()` once after drain. `handleStepUpdateImpact` still runs per - save (unchanged server behavior). -- `schema/action.ts`: `specificDateTime: z.iso.datetime().nullable().optional()`; add - `superRefine` cross-field check guarded on all three delay fields being present. - `buildUpdateData`/`buildCreateData` already map `null` correctly. -- `sequence-step-card.tsx`: delete the two raw-value lines. - -### UI - -- `delay-selector.tsx`: re-sync `localValue` when `delayValue` prop changes (effect keyed on - prop). Import `DelayUnit` from the hook instead of redeclaring. -- `use-delay-state.ts`: reset view when `step.id` or the stored delay triple changes - (server refresh), without overwriting an in-progress edit. -- Pass `isSaving` to `TimeRangeSelector` for consistency. - -## Phases - -1. **Helpers + tests first (TDD).** Create `lib/delay.ts` and - `apps/builder/__tests__/sequence-delay.test.ts`: round-trip every unit; 120 min stored - as minutes; 90 min stored as hours (→ 90 Minutes); hours→days conversion; null unit; - contradictory rows; immediate; specificTime with/without date. -2. **Save flow.** `use-delay-state.ts`, `use-sequence-step.ts`, `schema/action.ts`, - `sequence-step-card.tsx` per Design. -3. **UI sync.** `delay-selector.tsx`, `useDelayState` reset, `TimeRangeSelector` `isSaving`. -4. **Verify.** `pnpm --filter builder test -- sequence`, `pnpm lint`, - `pnpm --filter builder check-types`. Browser reproduction of 4 scenarios: - 2 Hours → Minutes → F5 shows "2 Minutes"; Hours → Days → F5 shows days not 120 days; - 90 Minutes → F5 shows "90 Minutes"; Specific time → Days → F5 shows no stale date. - -## Files touched - -- `apps/builder/src/features/sequences/lib/delay.ts` (new) -- `apps/builder/__tests__/sequence-delay.test.ts` (new) -- `apps/builder/src/features/sequences/hooks/use-delay-state.ts` -- `apps/builder/src/features/sequences/hooks/use-sequence-step.ts` -- `apps/builder/src/features/sequences/schema/action.ts` -- `apps/builder/src/features/sequences/components/sequence-step-card.tsx` -- `apps/builder/src/features/sequences/components/delay-selector.tsx` - -No DB migration. No worker/scheduler change. - -## Risks - -- MEDIUM: rows previously saved wrong (e.g. 120 min + unit minutes) will now display the - truthful "120 Minutes" instead of "2 Hours". Correct per DB; users may notice. -- LOW: FIFO queue replays every rapid edit, each triggering `handleStepUpdateImpact`. - Same per-save cost as today; only the previously-dropped saves are added. -- LOW: cross-field refine rejects contradictory payloads with a generic toast. Only the - builder UI sends this payload and it will always be consistent after the fix. - -Complexity: MEDIUM. - -## Global Constraints (binding for every task) - -- No `any`. No hardcoded user-facing strings (use `useTranslations()`; keys `sequences.delayUnits.*`, `sequences.afterText`, `sequences.timeValidation`, `messages.unknownError` already exist in `apps/builder/messages/en.json`). -- Business rules expressed as lookup tables (`Record` / ordered arrays), not if-else chains. -- Reuse existing handlers; do not add parallel helpers that duplicate `handleSave`, `buildUpdateData`, etc. -- `handleSave`'s call sites in `useTimeRangeState`, `handleSelectFlow`, `handleActiveChange` must keep working without edits to their payload shape (`flowId`, `isActive`, `anytime`, `sendTimeStart`, `sendTimeEnd`, `sendDays`). -- Schema cross-field validation must only run when `delayUnit`, `delayDays` and `delayMinutes` are ALL present in the payload. -- Scheduler, worker, `packages/*` are NOT touched. No DB migration. -- Tests live in `apps/builder/__tests__/` (vitest, `describe/test/expect` style, see `update-smart-response-delay-schema.test.ts`). Run with `pnpm --filter builder test -- `. -- Before reporting done: `pnpm fix` on touched files is allowed; `pnpm --filter builder check-types` and `pnpm lint` must pass. -- Commit per task with `(): ` (lowercase after colon, ≤100 chars). Stage specific files only, never `git add -A`. Never `--no-verify`. -- Do not use `git add -A` / `git add .`. Do not touch files outside the list in each task. - -## Task 1: Pure delay helpers + unit tests - -Files: create `apps/builder/src/features/sequences/lib/delay.ts`, create `apps/builder/__tests__/sequence-delay.test.ts`. - -Write the tests first, watch them fail, then implement. - -### Exports of `lib/delay.ts` - -```ts -export const DELAY_UNITS = ["immediate", "minutes", "hours", "days", "specificTime"] as const -export type DelayUnit = (typeof DELAY_UNITS)[number] - -export const MINUTES_PER_HOUR = 60 -export const MINUTES_PER_DAY = 24 * MINUTES_PER_HOUR -export const MIN_DELAY_VALUE = 1 -export const MAX_DELAY_VALUE = 99_999 - -export type StoredDelayFields = { - delayDays: number - delayMinutes: number - delayUnit?: string | null - specificDateTime?: Date | null -} - -export type DelayView = { - unit: DelayUnit - value: number // display number; 1 for immediate/specificTime - specificDateTime: string // datetime-local input value ("YYYY-MM-DDTHH:mm") or "" -} - -export type StoredDelay = { - delayDays: number - delayMinutes: number - delayUnit: DelayUnit - specificDateTime: string | null // ISO string for specificTime, null otherwise -} - -export function isDelayUnit(value: unknown): value is DelayUnit -export function isDelayValueInRange(value: number): boolean // integer, MIN..MAX inclusive -export function isStoredDelayConsistent(fields: { delayDays: number; delayMinutes: number; delayUnit: DelayUnit }): boolean -export function stepToDelayView(step: StoredDelayFields | undefined): DelayView -export function delayViewToStored(view: { unit: DelayUnit; value: number; specificDateTimeIso?: string | null }): StoredDelay -export function toLocalDateTimeInputValue(date: Date): string // "YYYY-MM-DDTHH:mm" in browser local time -export function oneHourFromNowLocal(): string // toLocalDateTimeInputValue(now + 1h) -``` - -### Rules - -`isStoredDelayConsistent` — one predicate per unit in a `Record boolean>`: - -| unit | consistent iff | -|---|---| -| immediate | days = 0 and minutes = 0 | -| minutes | days = 0 (minutes ≥ 0) | -| hours | days = 0 and minutes % 60 = 0 | -| days | minutes = 0 | -| specificTime | days = 0 and minutes = 0 | - -`stepToDelayView(step)`: -- `undefined` step → `{ unit: "days", value: 1, specificDateTime: "" }` (matches current new-step default). -- If `step.delayUnit` is a valid `DelayUnit` AND (`isStoredDelayConsistent` holds; for `specificTime` additionally `step.specificDateTime` non-null) → use the stored unit. Value: days → `delayDays`; hours → `delayMinutes / 60`; minutes → `delayMinutes`; immediate/specificTime → 1. Exception: a stored relative unit whose value would be 0 (e.g. `minutes` with 0 minutes) is NOT accepted → fall through to inference. -- Otherwise infer from numbers, first match wins, in this order (an ordered array of `{ unit, matches, value }` entries): - 1. days > 0 and minutes = 0 → `days`, value = days - 2. days > 0 and minutes > 0 → `minutes`, value = days*1440 + minutes - 3. minutes > 0 and minutes % 60 = 0 → `hours`, value = minutes/60 - 4. minutes > 0 → `minutes`, value = minutes - 5. else → `immediate`, value = 1 -- `specificDateTime` view string: `toLocalDateTimeInputValue(step.specificDateTime)` when non-null, else `""` (regardless of unit — so the previously chosen date is still shown if the user switches back). - -`delayViewToStored({ unit, value, specificDateTimeIso })` — a `Record { delayDays, delayMinutes }>`: -- days → `{ value, 0 }`; hours → `{ 0, value*60 }`; minutes → `{ 0, value }`; immediate → `{ 0, 0 }`; specificTime → `{ 0, 0 }`. -- `delayUnit` = unit. `specificDateTime` = `specificDateTimeIso ?? null` for `specificTime`, always `null` for every other unit. - -`toLocalDateTimeInputValue` — same formatting as the existing `getOneHourFromNowLocal` in `delay-selector.tsx` / `use-delay-state.ts` (zero-padded month/day/hour/minute, local time). This replaces both duplicates in Task 2/3. - -### Test cases (all required) - -- round-trip for each of days(2), hours(2), minutes(30), immediate through `delayViewToStored` → `stepToDelayView`. -- stored `{0, 120, "minutes"}` → view `minutes/120` (NOT hours/2). -- stored `{0, 120, "hours"}` → view `hours/2`. -- stored `{0, 90, "hours"}` (inconsistent) → view `minutes/90`. -- stored `{0, 90, null}` → `minutes/90`; `{0, 120, null}` → `hours/2`; `{3, 0, null}` → `days/3`; `{1, 30, null}` → `minutes/1470`; `{0, 0, null}` → `immediate/1`. -- stored `{120, 0, "days"}` → `days/120` (accepted, consistent). -- stored `{0, 0, "minutes"}` → `immediate/1` (zero relative value not accepted). -- stored `{0, 0, "specificTime", specificDateTime: Date}` → `specificTime`, `specificDateTime` formatted local. -- stored `{0, 0, "specificTime", specificDateTime: null}` → `immediate/1`. -- stored `{0, 0, "bogus"}` → `immediate/1`. -- `undefined` → `days/1`. -- `delayViewToStored` for every unit, including `specificDateTime: null` for relative units and the ISO passthrough for specificTime. -- `isStoredDelayConsistent` table: every row above, positive and negative. -- `isDelayValueInRange`: 0 false, 1 true, 99_999 true, 100_000 false, 1.5 false, NaN false. -- `toLocalDateTimeInputValue(new Date(2026, 0, 5, 7, 3))` → `"2026-01-05T07:03"`. - -Commit: `feat(sequences): add pure delay unit conversion helpers` - -## Task 2: Save flow — schema, hooks, card - -Files: `apps/builder/src/features/sequences/schema/action.ts`, `apps/builder/src/features/sequences/hooks/use-sequence-step.ts`, `apps/builder/src/features/sequences/hooks/use-delay-state.ts`, `apps/builder/src/features/sequences/components/sequence-step-card.tsx`, create `apps/builder/__tests__/upsert-sequence-step-schema.test.ts`. - -Depends on Task 1 exports. - -### `schema/action.ts` - -- `delayUnit: z.enum(DELAY_UNITS).optional()` (import `DELAY_UNITS` from `../lib/delay`). -- `specificDateTime: z.iso.datetime().nullable().optional()`. -- Add `.superRefine` on `upsertSequenceStepRequest`: when `delayUnit`, `delayDays` and `delayMinutes` are ALL defined and `!isStoredDelayConsistent(...)`, add an issue on path `["delayUnit"]` with message `"delayUnit does not match delayDays/delayMinutes"`. When `delayUnit === "specificTime"` and all three are present, additionally require `specificDateTime` to be a non-null string (issue on `["specificDateTime"]`). Any payload missing one of the three delay fields is NOT checked (legacy partial payloads must pass unchanged). -- Tests in `upsert-sequence-step-schema.test.ts`: consistent triple passes for every unit; `days/0/120` fails; `hours/0/90` fails; `minutes/1/5` fails; partial `{ delayDays: 3 }` passes; partial `{ delayUnit: "hours" }` passes; `specificTime` with null date fails, with ISO passes; `specificDateTime: null` accepted on a relative unit; `delayUnit: "bogus"` fails. -- `buildUpdateData`/`buildCreateData` in the action already map `null` → `null`; do not change the action file. - -### `hooks/use-sequence-step.ts` - -- Import `DelayUnit`, `DelayView`, `delayViewToStored` from `../lib/delay`. Re-export `DelayUnit` (other files import it from here today) and keep exporting `Step`, `WEEKDAY_ORDER`. -- Remove props `currentDelayUnit` and `currentDelayValue` from `UseSequenceStepProps`. -- Replace `changedFields.delayUnit / delayValue / specificDateTime` with a single optional `delay?: { unit: DelayUnit; value: number; specificDateTime?: string }` (`specificDateTime` is the datetime-local string). Other fields unchanged. -- Payload building for the delay part: `const stored = delayViewToStored({ unit, value, specificDateTimeIso })` where `specificDateTimeIso = unit === "specificTime" && specificDateTime ? new Date(specificDateTime).toISOString() : null`; spread `delayDays`, `delayMinutes`, `delayUnit`, `specificDateTime` from `stored` into the payload. This clears `specificDateTime` (null) on every relative/immediate save. -- Validation for `specificTime` (must be in the future; after `previousStepTime` when not first) runs whenever `delay.unit === "specificTime"`, i.e. on both first pick and later edits. -- Replace the `isSavingRef` early-return with a FIFO queue: - - `const saveQueueRef = useRef>(Promise.resolve())`, `const pendingSavesRef = useRef(0)`. - - `handleSave` validates and builds the full payload synchronously, increments `pendingSavesRef`, sets `isSaving` true, then chains `saveQueueRef.current = saveQueueRef.current.then(() => performSave(payload))`. `performSave` never rejects (it catches, toasts `messages.unknownError`, and resolves `false`); on success resolves `true` and calls `onSaved?.()`. After each item, decrement `pendingSavesRef`; when it reaches 0 set `isSaving` false and call `router.refresh()` exactly once. - - `handleSave` returns `Promise` (true = persisted). Validation failures resolve `false` without enqueuing. -- Keep `handleDelete`, `handleSelectFlow`, `handleActiveChange` behavior unchanged. - -### `hooks/use-delay-state.ts` - -- Delete the local `getOneHourFromNowLocal`, `getInitialDelayUnit`, `getInitialDelayValue`, `getInitialSpecificDateTime`. Initialize state from `stepToDelayView(step)`. -- Hold one `DelayView` state object (`view`) instead of three separate states; keep returning `delayUnit`, `delayValue`, `specificDateTime` and the three handlers so `sequence-step-card.tsx` and `DelaySelector` props stay the same. -- `onSave` type becomes `(fields: { delay: { unit: DelayUnit; value: number; specificDateTime?: string } }) => Promise`. -- `handleDelayUnitChange(unit)`: next view = `{ ...view, unit }`; if `unit === "specificTime"` and `view.specificDateTime` is empty, set `specificDateTime = oneHourFromNowLocal()`. Optimistically set the view, then `onSave({ delay: nextView })`; if it resolves `false`, revert to the previous view. -- `handleDelayValueChange(value)`: next view = `{ ...view, value }`; same optimistic save + revert. -- `handleSpecificDateTimeChange(dateTime)`: next view = `{ ...view, unit: "specificTime", specificDateTime: dateTime }`; only save when `dateTime` is non-empty; same revert. -- Add `useEffect` that re-derives the view via `stepToDelayView(step)` when `step?.id`, `step?.delayDays`, `step?.delayMinutes`, `step?.delayUnit` or `step?.specificDateTime?.getTime()` change, so a server refresh with different data wins. No effect on first render beyond the initializer. - -### `components/sequence-step-card.tsx` - -- Remove the `currentDelayUnit` / `currentDelayValue` arguments. -- Pass `isSaving` to `TimeRangeSelector` as a new optional `disabled` prop ONLY if that component already exposes one; otherwise leave `TimeRangeSelector` untouched (Task 3 handles it). - -Run `pnpm --filter builder test -- sequence`, `pnpm --filter builder check-types`, `pnpm lint`. - -Commit: `fix(sequences): persist delay unit changes and queue step saves` - -## Task 3: UI sync — DelaySelector and TimeRangeSelector - -Files: `apps/builder/src/features/sequences/components/delay-selector.tsx`, `apps/builder/src/features/sequences/components/time-range-selector.tsx`, `apps/builder/src/features/sequences/components/sequence-step-card.tsx`. - -Depends on Task 1 and Task 2. - -### `delay-selector.tsx` - -- Import `DelayUnit`, `DELAY_UNITS`, `isDelayValueInRange`, `MIN_DELAY_VALUE`, `MAX_DELAY_VALUE`, `oneHourFromNowLocal` from `../lib/delay`. Delete the local `DelayUnit` type and `getOneHourFromNowLocal`. -- Build `delayUnitItems` by mapping `DELAY_UNITS` to `{ value, label: t(\`sequences.delayUnits.${unit}\`) }` (translation keys already exist for every unit; keep the `t()` call type-safe with the project's typed messages — check `apps/builder/messages/en.d.json.ts` for how nested keys are typed and mirror an existing dynamic-key usage if one exists, otherwise use an explicit `Record` of labels). -- Replace the three inline `!localValue || localValue < 1 || localValue > 99_999` checks with `isDelayValueInRange(localValue)`; use `MIN_DELAY_VALUE` / `MAX_DELAY_VALUE` for the input `min`/`max`. -- Re-sync `localValue` when the `delayValue` prop changes: `useEffect(() => { setLocalValue(delayValue) }, [delayValue])`. Also clear `showDelayValueError` in that effect. -- Do not change the disabled behavior or layout. - -### `time-range-selector.tsx` - -- Add optional prop `disabled?: boolean` and forward it to every interactive control (radio/select/time inputs/day toggles) so they mirror the DelaySelector while a save is in flight. Default `false`. - -### `sequence-step-card.tsx` - -- Pass `disabled={isSaving}` to `TimeRangeSelector`. - -Run `pnpm --filter builder test -- sequence`, `pnpm --filter builder check-types`, `pnpm lint`. - -Commit: `fix(sequences): keep delay input in sync and disable send-window controls while saving` diff --git a/docs/plans/default-reply-throttle-hybrid.md b/docs/plans/default-reply-throttle-hybrid.md deleted file mode 100644 index 95dea505a1..0000000000 --- a/docs/plans/default-reply-throttle-hybrid.md +++ /dev/null @@ -1,299 +0,0 @@ -# Plan: Hybrid Automation Throttle (Redis fast-path + Postgres source-of-truth) - -> Generic per-contact automation throttle. Default Reply activation frequency is the **first -> caller**; the table/service also fit default-story and flow-scoped throttles. Grounded in the -> project skills (`drizzle-database`, `worker-development`, `reliability-concurrency`, -> `testing-workflow`) and reviewed by Codex (3 rounds). Change log at the bottom. - -## Requirement restatement - -Default-reply throttling is **Redis-only** today (`SET NX EX `). Problems: (1) not durable -if Redis restarts; (2) hardcoded to "default reply". Goal (**Option C — Hybrid**, generalized): -- Redis fast path, **5-min TTL**, key embeds the window so setting changes invalidate instantly. -- Postgres durable source of truth for the real 1h / 24h window. -- One generic table `AutomationThrottle`, hash-partitioned by `workspaceId` (**32**), discriminated - by **`throttleType` (pgEnum) + `subjectId`**. -- Reuse/refine the existing `defaultReplyThrottleService`; do not fork a parallel one. -- No Bloom filter. - -**`allTime` = unbounded (`windowSeconds` 0):** always allows, BUT still records -`lastTriggeredAt` (matching v1's `EVERY_TIME`). Recording even under `allTime` means -switching to a bounded frequency later throttles from the real last reply — no bonus reply, no -stale-timestamp resurrection. Implemented via the same claim: `setWhere` with a 0-second interval -is always true, so the claim always wins (records) and always allows; the Redis read is skipped. - ---- - -## Design patterns applied - -- **Strategy-as-data (no if-else):** frequency→window is the existing `Record` map (`DEFAULT_REPLY_FREQUENCY_WINDOW_SECONDS`) — reused, not re-branched. -- **Repository pattern:** all SQL in `automation-throttle.repository.ts` (`claim`/`release`/ - `purgeStale`); the business service holds orchestration (Redis + repo). Honors - `.agents/rules/data-access.md` (no `db` in app layer). -- **Generic service (channel-agnostic):** the throttle service knows nothing about channels or - default-reply; callers pass `throttleType` + `subjectId` + `windowSeconds`. Satisfies "shared - code not hardcoded per channel". - ---- - -## Key design decisions - -### 1. Schema shape — separate "what is throttled" from "throttle state" - -| Concern | Column(s) | -|---|---| -| Who | `workspaceId`, `contactInboxId` (both `bigintAsString`) | -| **What** (extensible) | `throttleType` (**pgEnum**), `subjectId` (`bigintAsString`, no default; `"0"` = singleton) | -| State | `lastTriggeredAt` (`timestamptz`), `claimId` (`uuid`) | - -**`throttleType` is a `pgEnum`, per `drizzle-database` skill** ("a column constrained to a fixed set -of strings MUST use `pgEnum`"). Follow the 3-step convention: -```ts -// packages/database/src/partials/automation-throttle.ts -export const automationThrottleTypes = z.enum(["defaultReply"]) // + "defaultStory", "flow" later -export type AutomationThrottleType = z.infer -// exported from partials/index.ts; pgEnum "automationThrottleType" in the schema file -``` -Adding a scenario later = one **additive** migration (`ALTER TYPE "automationThrottleType" ADD -VALUE 'flow'`) + the zod enum value. DB-level typo/injection safety; controlled key values. - -- **`subjectId` has no DB default** (Codex) — the service always passes it explicitly (`"0"` for - singleton `defaultReply`, or the `flowId` for a `flow` throttle). -- **`windowSeconds` is NOT stored** — it is caller policy, read fresh per message and passed to the - service. The row is only `lastTriggeredAt`. -- **Natural composite PK** `(workspaceId, contactInboxId, throttleType, subjectId)` — no surrogate - `sharedColumns.id` (this is a state table keyed by its natural identity, and the PK doubles as the - `ON CONFLICT` target). PK includes the partition key `workspaceId` as Postgres requires. - -### 2. Layers - -| Layer | Role | On failure | -|---|---|---| -| Redis | Fast cache "recently decided" per `(ws, ci, type, subject, window)` | error ⇒ skip → DB | -| Postgres | Durable source of truth | error ⇒ **fail-open** + metric + rate-limited log | - -Naming: throttle is consumed at **enqueue**; column is **`lastTriggeredAt`** ("last queued"). - -### 3. Redis fast-path — cache both decisions, **window in the key** - -Key: `throttle:{throttleType}:{subjectId}:{workspaceId}:{contactInboxId}:w{windowSeconds}`. -(Redis keys may contain `:`; only BullMQ `jobId` may not — that rule applies to the purge cron id.) - -- **Window in the key** ⇒ a setting change routes to a fresh namespace, so every stale marker - (positive *and* negative) is instantly unreachable and self-expires (≤5 min); the next lookup - misses and the DB re-decides. No scan, no delete, no extra Redis key/read. `windowSeconds` is - already in hand per message. `allTime` (`windowSeconds` 0) skips the Redis read and - record-and-allows through the same claim (its `setWhere` is always true). -- **`remainingSeconds` is DB-computed** (never app clock — Codex) and returned by the repository for - **both** branches (denied uses a required follow-up `SELECT`). `markerTtl = clamp(remainingSeconds, - 1, FASTPATH_TTL=300)`; skip caching if `<= 0`. -- Presence ⇒ `denied` fast (no DB); absence ⇒ DB. -- **Positive marker write** reuses the shared Redis util. `distributedStore` currently has no plain - `SET key val EX` (only `setNumberIfNotExists`, which is `NX`); add a minimal generic - `setNumber(key, value, ttlSeconds)` to the store factory (not channel-specific). Value is - irrelevant to the deny decision (existence only). -- **`windowSeconds` is validated** as a positive integer (per-type whitelist `{3600, 86400}` for - default-reply) so generic callers can't explode key cardinality. - -### 4. Postgres atomic claim — Drizzle query builder (not raw SQL), race-safe - -Prefer the model/query-builder (project rule "use the model, not a raw query"); only unavoidable -computed expressions use parameterized `sql` fragments (no injection): - -```ts -const [won] = await db - .insert(automationThrottleModel) - .values({ workspaceId, contactInboxId, throttleType, subjectId, lastTriggeredAt: sql`now()`, claimId }) - .onConflictDoUpdate({ - target: [automationThrottleModel.workspaceId, automationThrottleModel.contactInboxId, - automationThrottleModel.throttleType, automationThrottleModel.subjectId], - set: { lastTriggeredAt: sql`now()`, claimId }, - setWhere: sql`${automationThrottleModel.lastTriggeredAt} <= now() - make_interval(secs => ${windowSeconds})`, - }) - .returning({ - remainingSeconds: sql`greatest(0, ceil(extract(epoch from (${automationThrottleModel.lastTriggeredAt} + make_interval(secs => ${windowSeconds}) - now()))))::int`, - }) -``` - -- **Row returned** ⇒ won (fresh insert, or update because the prior trigger is outside the window) - ⇒ write Redis marker with `clamp(remainingSeconds,1,300)` ⇒ `acquired`. -- **No row** ⇒ conflict + `setWhere` false ⇒ `denied`; a **required** follow-up builder `SELECT` - returns the DB-computed `remainingSeconds` for the negative marker TTL. -- **Concurrency (reliability-concurrency skill):** the single `onConflictDoUpdate` is atomic — the - row lock on the conflicting tuple + `setWhere` yields exactly one winner; a re-run is idempotent - (same end state). No read-then-write. No transaction needed (one statement). - -### 5. Claim token + `release` (rollback = delete-by-claimId, CAS-safe, builder) - -```ts -type AutomationThrottleClaim = - | { result: "acquired"; claimId: string; remainingSeconds: number } - | { result: "denied" } - | { result: "bypassed" } -``` - -`release` (only for `acquired`, when `integrationQueue.add(sendFlow)` throws): -```ts -await db.delete(automationThrottleModel).where(and( - eq(automationThrottleModel.workspaceId, workspaceId), - eq(automationThrottleModel.contactInboxId, contactInboxId), - eq(automationThrottleModel.throttleType, throttleType), - eq(automationThrottleModel.subjectId, subjectId), - eq(automationThrottleModel.claimId, claimId), // CAS -)) -``` -- **Delete-by-claimId is fully correct** and needs no previous-value capture: a won claim implies - the prior state was already eligible (or absent), and "no row" == eligible. So deleting restores - eligibility for both insert and update cases. The `claimId` predicate makes a delayed release a - no-op if a newer claim already replaced it. Pure builder, no CTE, no raw upsert. -- **Redis:** `delete(key)` — best-effort; worst case is a cache miss (falls through to Postgres, the - authority), never a wrong send. - -### 6. Why NOT a Bloom filter (Codex concurred) -FP ⇒ missed customer reply; no per-item TTL/delete; no atomic single-winner claim; no scale -justification (rows bounded by distinct `(ws, ci, type, subject)`; markers tiny + auto-expire). - -### 7. Migration (raw SQL, hash-partition by `workspaceId` ×32) - -`make:migration` cannot emit `PARTITION BY`; hand-write the SQL (mirroring `ContactOnSequence`); the -Drizzle model is **typing only**. Apply manually after review (migration-safety rule). - -```sql -CREATE TYPE "automationThrottleType" AS ENUM ('defaultReply'); -CREATE TABLE "AutomationThrottle" ( - "workspaceId" bigint NOT NULL, - "contactInboxId" bigint NOT NULL, - "throttleType" "automationThrottleType" NOT NULL, - "subjectId" bigint NOT NULL, -- no DEFAULT; caller passes it ("0" = singleton) - "lastTriggeredAt" timestamp(6) with time zone NOT NULL DEFAULT now(), - "claimId" uuid NOT NULL, - CONSTRAINT "AutomationThrottle_pkey" - PRIMARY KEY ("workspaceId","contactInboxId","throttleType","subjectId"), - CONSTRAINT "AutomationThrottle_workspace_fk" - FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE CASCADE, - CONSTRAINT "AutomationThrottle_contact_inbox_fk" - FOREIGN KEY ("contactInboxId") REFERENCES "ContactInbox"("id") ON DELETE CASCADE -) PARTITION BY HASH ("workspaceId"); - -DO $$ BEGIN - FOR i IN 0..31 LOOP - EXECUTE format( - 'CREATE TABLE "AutomationThrottle_p%s" PARTITION OF "AutomationThrottle" - FOR VALUES WITH (MODULUS 32, REMAINDER %s)', i, i); - END LOOP; -END $$; - -CREATE INDEX "AutomationThrottle_lastTriggeredAt_idx" ON "AutomationThrottle" ("lastTriggeredAt"); -``` -- **`workspaceId`↔`contactInboxId` consistency is app-enforced** — `ContactInbox` has no - `workspaceId`, so a composite FK is impossible; the service derives both from the same - conversation (same convention as `ContactOnSequence`). -- Modulus fixed at creation (**32**). Purge cron: `DELETE ... WHERE "lastTriggeredAt" < now() - - interval '48 hours'` (uses the index). - -### 8. Setting changes — no mass Redis delete, honored on the next message -`windowSeconds` in the key means a frequency change routes to a fresh namespace; stale markers -self-expire (≤5 min), never scanned/deleted. `allTime` (windowSeconds 0) record-and-allows — -always replies AND keeps `lastTriggeredAt` current, so a later switch to a bounded frequency -throttles from the real last reply (v1 parity — no bonus reply). **User's example:** -`oncePerHour`→`allTime`, contact messages after 10 s → always allowed → bot replies. -Deploy note: old-namespace keys (`default-reply:last-sent:*`) self-expire ≤24h. - ---- - -## Touchpoints - -**Database (`packages/database`)** — schema-registration cascade (drizzle skill): -1. `src/partials/automation-throttle.ts` — `automationThrottleTypes` zod enum; export from `partials/index.ts`. -2. `src/schema/automation-throttle.ts` — `pgEnum` + `pgTable` (typing only) with the composite PK. -3. `src/schema/index.ts` — `export * from "./automation-throttle"`. -4. `src/types.ts` — `export type AutomationThrottle = typeof schema.automationThrottleModel.$inferSelect`. -5. `src/relations/index.ts` — **TWO edits** (import + spread) if relations are defined; read back to verify both. -6. `drizzle/_create_automation_throttle/migration.sql` — hand-written partition DDL. **Apply manually after review.** -7. `src/repositories/automation-throttle.repository.ts` — `claim`, `release`, `purgeStale` via query builder; `claimId = crypto.randomUUID()`. - -**Redis (`packages/redis`)** -8. Add generic `setNumber(key, value, ttlSeconds)` (plain `SET … EX`) to the `distributedStore` factory. - -**Business (`packages/business`)** -9. Refine the existing `default-reply/throttle.ts` → generic `automation-throttle/service.ts` - (`automationThrottleService.tryAcquire/release`); a thin default-reply wrapper keeps the current - call site stable. Reuse `DEFAULT_REPLY_FREQUENCY_WINDOW_SECONDS`. Constant - `AUTOMATION_THROTTLE_FASTPATH_TTL_SECONDS = 300`. - -**Worker (`apps/worker`)** -10. `automated-response/default-reply.ts` — call `tryAcquire({ throttleType:"defaultReply", - subjectId:"0", windowSeconds })`; thread the claim into `release`. Logic otherwise unchanged. -11. Retention cron (worker `ScheduleJobData` 4-touchpoint flow): key+type+union in - `worker-config/queues/schedule`, `upsertJobScheduler` in `register-schedules.ts`, `case` in - `schedule/worker.ts`, handler `schedule/handlers/purge-automation-throttle.ts`. Wrap the handler - body in `distributedLock.runExclusive` (TTL < cadence); re-driveable cron ⇒ `removeOnComplete: - true`; `jobId` uses `-` (never `:`). Log with the `err` key. - -**Tests (`__tests__/`, Vitest, 80% coverage gate)** -12. Business unit (Redis + repo mocked): acquired / denied / bypassed; window boundary; - DB-computed remaining incl. denied branch; window-in-key setting change (looser allows, stricter - denies, `allTime` bypasses); Redis-down→DB; DB-down→fail-open; release delete-by-claimId CAS + - stale-release no-op; Redis-delete best-effort → cache-miss-not-wrong-send; type/subject - isolation. Repository integration: two concurrent claims → one wins (idempotent re-run). Purge - cron: `jobId` asserted `not.toContain(":")`. - ---- - -## Standards & requirements compliance - -| Requirement | How the plan meets it | -|---|---| -| Check docs, don't guess | Grounded in `drizzle-database`, `worker-development`, `reliability-concurrency`, `testing-workflow` skills + 3 Codex rounds | -| Modular, no confusing if-else | Strategy-as-data map for freq→window; switch-free service; repository/service split | -| Shared code not channel-hardcoded | Generic `automationThrottleService` — no channel/default-reply specifics; caller passes type/subject/window | -| Enum/object/array for business logic | `throttleType` **pgEnum** + zod; window map is a `Record` | -| Reuse existing handler | Refine `defaultReplyThrottleService` → generic; reuse `triggerDefaultReplyFlow`, `DEFAULT_REPLY_FREQUENCY_WINDOW_SECONDS`, `distributedStore`, `distributedLock` | -| No code smell / clean | One-statement claim, delete-by-claimId rollback (no CTE), no previous-value bookkeeping | -| Scalable | Hash-partition ×32; Redis absorbs bursts; DB writes ≤1/window/(ws,ci,type,subject) | -| Standard by project | `sharedColumns`/`bigintAsString`/`pgEnum`/repository/service conventions; schema-registration cascade | -| Design patterns | Repository, Strategy-as-data, generic service (channel-agnostic) | -| Business layer | All orchestration in `packages/business`; SQL in `packages/database` repository | -| No `any` | Typed claim union; `sql` on computed exprs; zod-inferred types | -| Friendly names | `automationThrottleService`, `tryAcquire`, `lastTriggeredAt`, `remainingSeconds` | -| No duplicate code | Single generic service; default-reply is a thin wrapper | -| Model over raw query | Drizzle builder for claim/release/purge; `sql` only for computed window/remaining exprs (parameterized) | -| Don't break old flow | `triggerDefaultReplyFlow` signature/behavior preserved; `allTime`/skip paths unchanged; migration additive | -| Avoid SQL injection | Parameterized builder + `sql` placeholders; enum-constrained `throttleType` | -| High load | Redis fast-path, single-statement claim, indexed point lookups, partitioning | -| All cases tested | Test matrix above + 80% coverage gate (lint→types→test→coverage) | - ---- - -## Phases (each ends with lint → types → test) -- **P1 — DB:** partials enum, schema (pgEnum+table), index/types/relations registration, repository, - hand-written migration. **Stop for SQL review before apply.** -- **P2 — Redis:** add `distributedStore.setNumber`. -- **P3 — Service:** generic `automationThrottleService` + default-reply wrapper (refined from the old service). -- **P4 — Worker:** wire `default-reply.ts`. -- **P5 — Retention:** purge cron (4-touchpoint + `distributedLock`). -- **P6 — Tests + full gate** (lint, touched `check-types`, Vitest, coverage ≥80%). - -## Risks -| Sev | Risk | Mitigation | -|---|---|---| -| HIGH | Partitioned-table Drizzle drift | Model = typing only; hand-written migration; manual inspection | -| MED | DB-error fail-open sends repeats in an outage | Explicit + metric + rate-limited log | -| MED | New DB write per trigger | ≤1/window/(ws,ci,type,subject); Redis absorbs bursts; indexed PK lookups | -| LOW | pgEnum extension needs a migration | `ALTER TYPE ADD VALUE` (additive, non-blocking) documented | -| LOW | ws↔ci pairing not DB-enforceable | App-enforced invariant (documented) | - -## Decisions (finalized) -`AutomationThrottle` · `throttleType` **pgEnum** + `subjectId` · 32 partitions · fail-open+observable -· no Bloom · `lastTriggeredAt` · TTL 5 min · window-in-key · delete-by-claimId rollback · builder-over-raw. - -## Change log -- Generalized to `AutomationThrottle` (`throttleType`+`subjectId`); window-in-key for instant - setting changes; Codex rounds 1–3 (claimId CAS, DB-computed remaining, best-effort Redis delete, - app-enforced ws↔ci, window validation, worker-config cascade). -- **Doc-driven revision (this pass):** `throttleType` → **pgEnum** (drizzle skill); claim/release via - **Drizzle builder** not raw CTE; rollback simplified to **delete-by-claimId** (no previous-value - capture); schema-registration + worker-cron cascades enumerated; `distributedStore.setNumber` - added; `distributedLock.runExclusive` + `removeOnComplete:true` + `-` jobId for the purge cron; - logging `err` key; added Standards-compliance matrix. diff --git a/integrations/meta-conversions/__tests__/events.test.ts b/integrations/meta-conversions/__tests__/events.test.ts index 62f20ab05a..f16dc8971d 100644 --- a/integrations/meta-conversions/__tests__/events.test.ts +++ b/integrations/meta-conversions/__tests__/events.test.ts @@ -304,4 +304,244 @@ describe("Meta Conversions events API", () => { }, }) }) + + test("sends test_event_code at the request top level only when provided", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + const event = { + eventName: "Purchase", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-test", + messagingChannel: "messenger" as const, + pageId: "page-1", + pageScopedUserId: "psid-1", + value: "250", + currency: "VND", + } + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event, + testEventCode: "TEST33520", + }) + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event, + }) + + const [withCode, withoutCode] = mocks.post.mock.calls.map( + (call) => (call[1] as { json: Record }).json, + ) + expect(withCode.test_event_code).toBe("TEST33520") + expect(withoutCode).not.toHaveProperty("test_event_code") + // The event payload itself is unaffected by the test code. + expect(withCode.data).toEqual(withoutCode.data) + }) + + test("explicit actionSource business_messaging is identical to omitting it", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + version: "v24.0", + event: { + actionSource: "business_messaging", + eventName: "LeadSubmitted", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-1", + messagingChannel: "messenger", + pageId: "page-1", + pageScopedUserId: "psid-1", + currency: "USD", + value: "42.50", + contentCategory: "Education", + contentName: "Landing Page A", + }, + }) + + expect(mocks.post).toHaveBeenCalledWith("v24.0/dataset-1/events", { + headers: { Authorization: "Bearer token-1" }, + json: { + data: [ + { + event_name: "LeadSubmitted", + event_time: 1_786_357_230, + event_id: "event-1", + action_source: "business_messaging", + messaging_channel: "messenger", + user_data: { + page_id: "page-1", + page_scoped_user_id: "psid-1", + }, + custom_data: { + currency: "USD", + value: 42.5, + content_category: "Education", + content_name: "Landing Page A", + }, + }, + ], + partner_agent: "ChatConnectX", + }, + }) + }) + + test("builds a non-messaging email event with no messaging identity", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + version: "v24.0", + event: { + actionSource: "email", + eventName: "Lead", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-9", + userData: { + em: ["hash-em"], + ph: ["hash-ph"], + external_id: ["hash-ext"], + }, + }, + }) + + const [, options] = mocks.post.mock.calls[0] + const payload = options?.json as + | { data?: Record[] } + | undefined + expect(payload?.data?.[0]).toMatchObject({ + event_name: "Lead", + action_source: "email", + user_data: { + em: ["hash-em"], + ph: ["hash-ph"], + external_id: ["hash-ext"], + }, + }) + expect(payload?.data?.[0]).not.toHaveProperty("messaging_channel") + expect(payload?.data?.[0]?.user_data).not.toHaveProperty("page_id") + expect(payload?.data?.[0]?.user_data).not.toHaveProperty("ig_sid") + expect(payload?.data?.[0]?.user_data).not.toHaveProperty("ctwa_clid") + // `user_data` on a non-messaging event IS the hashed customer info, + // exactly (no channel identity keys mixed in) — `userData` is now a + // required field on the non-messaging identity, so this can never come + // back empty. + expect(payload?.data?.[0]?.user_data).toEqual({ + em: ["hash-em"], + ph: ["hash-ph"], + external_id: ["hash-ext"], + }) + }) + + test("includes content_type and content_ids when provided, omits them when absent", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "ViewContent", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-10", + messagingChannel: "messenger", + pageId: "page-1", + pageScopedUserId: "psid-1", + contentType: "product_group", + contentIds: ["sku-1", "sku-2"], + }, + }) + + const [, firstOptions] = mocks.post.mock.calls[0] + const firstPayload = firstOptions?.json as + | { data?: Record[] } + | undefined + expect(firstPayload?.data?.[0]).toMatchObject({ + custom_data: { + content_type: "product_group", + content_ids: ["sku-1", "sku-2"], + }, + }) + + mocks.post.mockClear() + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "ViewContent", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-11", + messagingChannel: "messenger", + pageId: "page-1", + pageScopedUserId: "psid-1", + }, + }) + + const [, secondOptions] = mocks.post.mock.calls[0] + const secondPayload = secondOptions?.json as + | { data?: Record[] } + | undefined + expect(secondPayload?.data?.[0]).not.toHaveProperty("custom_data") + }) + + test("explicit contentType product_group beats the contents[]-derived product default", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + eventName: "Purchase", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-12", + messagingChannel: "messenger", + pageId: "page-1", + pageScopedUserId: "psid-1", + contentType: "product_group", + contents: [{ id: "sku-1", quantity: 1, itemPrice: 10 }], + }, + }) + + const [, options] = mocks.post.mock.calls[0] + const payload = options?.json as + | { data?: Record[] } + | undefined + expect(payload?.data?.[0]).toMatchObject({ + custom_data: { + content_type: "product_group", + num_items: 1, + }, + }) + }) + + test("passes a custom event name through unchanged", async () => { + mocks.post.mockResolvedValue({ data: { events_received: 1 } }) + + await sendConversionEvent({ + datasetId: "dataset-1", + accessToken: "token-1", + event: { + actionSource: "other", + eventName: "MyCustomEvent", + occurredAt: new Date("2026-08-10T10:20:30.000Z"), + eventId: "event-13", + userData: { + external_id: ["hash-ext"], + }, + }, + }) + + const [, options] = mocks.post.mock.calls[0] + const payload = options?.json as + | { data?: Record[] } + | undefined + expect(payload?.data?.[0]).toMatchObject({ + event_name: "MyCustomEvent", + action_source: "other", + }) + }) }) diff --git a/integrations/meta-conversions/src/apis/events.ts b/integrations/meta-conversions/src/apis/events.ts index 03e67978fa..bae1995782 100644 --- a/integrations/meta-conversions/src/apis/events.ts +++ b/integrations/meta-conversions/src/apis/events.ts @@ -1,5 +1,7 @@ import type { HashedCapiUserData, + MetaCapiActionSource, + MetaCapiContentType, PurchaseContentItem, } from "@chatbotx.io/utils/meta-capi" import { z } from "zod" @@ -14,70 +16,100 @@ import { } from "../lib/http-client" import type { MetaCapiEventName, MetaMessagingChannel } from "../schemas" -// Shared enrichment fields (plan #1/#3/#4) duplicated per channel-variant -// literal below, mirroring this file's pre-existing pattern of duplicating -// currency/value/contentCategory/contentName across the three variants -// rather than a common base type. -type MetaCapiEnrichmentFields = { - /** Hashed customer-info (plan #1) — merged into the channel's `user_data`. */ - userData?: HashedCapiUserData - /** Limited Data Use (plan #3) — emits the fixed top-level LDU triple. */ - limitedDataUse?: boolean - /** Purchase order id (plan #4) — `custom_data.order_id`. */ - orderId?: string | null - /** Purchase line items (plan #4) — `custom_data.contents[]`. */ - contents?: PurchaseContentItem[] | null -} - -type MessengerEventInput = { +// Fields shared by every action source. `contentType`/`contentIds` are new; +// the rest carry over unchanged from the previous per-variant literals. +type MetaCapiEventCommon = { eventName: MetaCapiEventName occurredAt: Date eventId: string - messagingChannel: "messenger" - pageId: string - pageScopedUserId: string currency?: string | null value?: string | number | null contentCategory?: string | null contentName?: string | null -} & MetaCapiEnrichmentFields + /** `custom_data.content_type` — explicit value wins over the + * `contents[]`-derived `"product"` default (see `buildCustomData`). */ + contentType?: MetaCapiContentType | null + /** `custom_data.content_ids`. */ + contentIds?: string[] | null + /** Hashed customer-info. For a business-messaging event it is merged into + * `user_data` alongside the channel identity keys; for a non-messaging + * event it IS `user_data` (identity keys don't exist there). */ + userData?: HashedCapiUserData + /** Limited Data Use — emits the fixed top-level LDU triple. */ + limitedDataUse?: boolean + /** Purchase order id — `custom_data.order_id`. */ + orderId?: string | null + /** Purchase line items — `custom_data.contents[]`. */ + contents?: PurchaseContentItem[] | null +} -type InstagramEventInput = { - eventName: MetaCapiEventName - occurredAt: Date - eventId: string - messagingChannel: "instagram" - instagramBusinessAccountId: string - igSid: string - currency?: string | null - value?: string | number | null - contentCategory?: string | null - contentName?: string | null -} & MetaCapiEnrichmentFields +// The three channel-identity shapes business-messaging events can carry. +// `actionSource` is OPTIONAL and fixed to `"business_messaging"` here so the +// ads-conversion sender (`apps/worker/.../ads-conversion/send-conversion- +// event.ts`, which never sets it) and every existing test keep compiling +// unchanged. +type BusinessMessagingIdentity = { + actionSource?: "business_messaging" +} & ( + | { + messagingChannel: "messenger" + pageId: string + pageScopedUserId: string + } + | { + messagingChannel: "instagram" + instagramBusinessAccountId: string + igSid: string + } + | { + messagingChannel: "whatsapp" + wabaId: string + ctwaClid: string + } +) -type WhatsappEventInput = { - eventName: MetaCapiEventName - occurredAt: Date - eventId: string - messagingChannel: "whatsapp" - wabaId: string - ctwaClid: string - currency?: string | null - value?: string | number | null - contentCategory?: string | null - contentName?: string | null -} & MetaCapiEnrichmentFields +// Every other action source: no messaging channel, no channel identity keys +// — Meta rejects `page_scoped_user_id`/`ig_sid`/`ctwa_clid` on a non- +// messaging event, so the union makes that combination unrepresentable. +// `userData` is REQUIRED here (unlike the business-messaging arm, which +// identifies the person via its channel identity keys and treats hashed +// customer info as an optional supplement): a non-messaging event has no +// other identity to send, so it must never type-check without one. +type NonMessagingIdentity = { + actionSource: Exclude + userData: HashedCapiUserData +} + +export type MetaConversionEventInput = MetaCapiEventCommon & + (BusinessMessagingIdentity | NonMessagingIdentity) -export type MetaConversionEventInput = - | MessengerEventInput - | InstagramEventInput - | WhatsappEventInput +// The business-messaging arm of `MetaConversionEventInput`, distributed over +// `messagingChannel` — used by `channelUserDataBuilders` and its dispatcher. +type MetaMessagingEventInput = MetaCapiEventCommon & BusinessMessagingIdentity +type MessengerEventInput = Extract< + MetaMessagingEventInput, + { messagingChannel: "messenger" } +> +type InstagramEventInput = Extract< + MetaMessagingEventInput, + { messagingChannel: "instagram" } +> +type WhatsappEventInput = Extract< + MetaMessagingEventInput, + { messagingChannel: "whatsapp" } +> type SendConversionEventInput = { datasetId: string accessToken: string version?: string event: MetaConversionEventInput + /** + * Meta's `test_event_code` (Events Manager → Test events). When set, the + * event is routed to the dataset's Test Events view instead of production + * reporting, where its full payload is shown. + */ + testEventCode?: string } const conversionEventsResponseSchema = z.object({}).passthrough() @@ -92,37 +124,55 @@ const conversionEventsResponseSchema = z.object({}).passthrough() // requires `ig_account_id` even though the public doc example still shows // `instagram_business_account_id` — see the instagram builder below. const channelUserDataBuilders = { - messenger: (event: MetaConversionEventInput) => ({ - page_id: (event as MessengerEventInput).pageId, - page_scoped_user_id: (event as MessengerEventInput).pageScopedUserId, + messenger: (event: MessengerEventInput) => ({ + page_id: event.pageId, + page_scoped_user_id: event.pageScopedUserId, }), - instagram: (event: MetaConversionEventInput) => ({ + instagram: (event: InstagramEventInput) => ({ // Live business_messaging endpoint requires `ig_account_id`; it rejects the // event as "Missing IG account ID parameter" (error_subcode 2804079) when // only `instagram_business_account_id` is sent, even though the public doc // example still lists the latter. We send BOTH (same value): the live API // requires `ig_account_id` and tolerates the doc-named key as unknown, so // this stays correct whichever name Meta consolidates on. - ig_account_id: (event as InstagramEventInput).instagramBusinessAccountId, - instagram_business_account_id: (event as InstagramEventInput) - .instagramBusinessAccountId, - ig_sid: (event as InstagramEventInput).igSid, + ig_account_id: event.instagramBusinessAccountId, + instagram_business_account_id: event.instagramBusinessAccountId, + ig_sid: event.igSid, }), - whatsapp: (event: MetaConversionEventInput) => ({ - whatsapp_business_account_id: (event as WhatsappEventInput).wabaId, - ctwa_clid: (event as WhatsappEventInput).ctwaClid, + whatsapp: (event: WhatsappEventInput) => ({ + whatsapp_business_account_id: event.wabaId, + ctwa_clid: event.ctwaClid, }), } as const satisfies { [Channel in MetaMessagingChannel]: ( - event: MetaConversionEventInput, + event: Extract, + ) => Record +} + +// Indexing `channelUserDataBuilders` by `event.messagingChannel` (a union +// key) narrows each builder's parameter to the INTERSECTION of all three +// channels' identity fields — a shape no single event value can satisfy +// structurally, even though the `messagingChannel` tag guarantees the match +// is safe at runtime. This is the ONE documented cast in this file, +// replacing the three per-variant `as MessengerEventInput` / +// `as InstagramEventInput` / `as WhatsappEventInput` casts that used to live +// inside each builder body. +const byMessagingChannel = ( + event: MetaMessagingEventInput, + builders: typeof channelUserDataBuilders, +): Record => { + const builder = builders[event.messagingChannel] as ( + event: MetaMessagingEventInput, ) => Record + return builder(event) } -// Purchase `content_type`/`num_items`/`contents[]` (plan #4). `num_items` is +// Purchase `content_type`/`num_items`/`contents[]`. `num_items` is // the SUM of each line item's quantity — NOT the array length, per Meta's // spec (a line item can itself represent multiple units of the same SKU). +// `content_type` itself is resolved by `buildCustomData` (explicit value +// wins over this default), not hard-coded here. const buildContentsData = (contents: PurchaseContentItem[]) => ({ - content_type: "product", num_items: contents.reduce((total, item) => total + item.quantity, 0), contents: contents.map((item) => ({ id: item.id, @@ -134,13 +184,19 @@ const buildContentsData = (contents: PurchaseContentItem[]) => ({ const buildCustomData = (event: MetaConversionEventInput) => { const hasValue = event.value !== null && event.value !== undefined const hasContents = Boolean(event.contents && event.contents.length > 0) + const hasContentIds = Boolean(event.contentIds && event.contentIds.length > 0) + // Explicit `contentType` wins over the `contents[]`-derived "product" + // default. + const contentType = event.contentType ?? (hasContents ? "product" : undefined) const hasAny = event.currency || hasValue || event.contentCategory || event.contentName || event.orderId || - hasContents + hasContents || + hasContentIds || + contentType return hasAny ? { custom_data: { @@ -151,6 +207,8 @@ const buildCustomData = (event: MetaConversionEventInput) => { : {}), ...(event.contentName ? { content_name: event.contentName } : {}), ...(event.orderId ? { order_id: event.orderId } : {}), + ...(contentType ? { content_type: contentType } : {}), + ...(hasContentIds ? { content_ids: event.contentIds } : {}), ...(hasContents && event.contents ? buildContentsData(event.contents) : {}), @@ -162,12 +220,12 @@ const buildCustomData = (event: MetaConversionEventInput) => { // Identity keys first, then hashed customer-info fields — the two never // collide (channel identity keys are page_id/ig_sid/etc, hashed fields are // em/ph/fn/ln/external_id). -const buildChannelUserData = (event: MetaConversionEventInput) => ({ - ...channelUserDataBuilders[event.messagingChannel](event), +const buildChannelUserData = (event: MetaMessagingEventInput) => ({ + ...byMessagingChannel(event, channelUserDataBuilders), ...(event.userData ?? {}), }) -// Limited Data Use (plan #3): a FIXED top-level triple, never arbitrary +// Limited Data Use: a FIXED top-level triple, never arbitrary // caller-supplied processing options — Meta auto-geolocates from this, // restricting only US-state users covered by state privacy law. const buildDataProcessingOptions = (event: MetaConversionEventInput) => @@ -179,13 +237,38 @@ const buildDataProcessingOptions = (event: MetaConversionEventInput) => } : {} +// Structural discriminant: `actionSource` is optional on +// `BusinessMessagingIdentity`, so a `Record` +// cannot narrow it — `messagingChannel` presence is the reliable tag. +function isBusinessMessagingEvent( + event: MetaConversionEventInput, +): event is MetaMessagingEventInput { + return "messagingChannel" in event +} + +const businessMessagingIdentityPayload = (event: MetaMessagingEventInput) => ({ + action_source: "business_messaging" as const, + messaging_channel: event.messagingChannel, + user_data: buildChannelUserData(event), +}) + +// Non-messaging `user_data` is hashed customer info only — it can never be +// empty because the business layer always emits `external_id`, which Meta +// lists among the parameters satisfying its "at least one of" rule. +const nonMessagingIdentityPayload = ( + event: MetaCapiEventCommon & NonMessagingIdentity, +) => ({ + action_source: event.actionSource, + user_data: event.userData, +}) + const buildConversionEventPayload = (event: MetaConversionEventInput) => ({ event_name: event.eventName, event_time: Math.floor(event.occurredAt.getTime() / 1000), event_id: event.eventId, - action_source: "business_messaging", - messaging_channel: event.messagingChannel, - user_data: buildChannelUserData(event), + ...(isBusinessMessagingEvent(event) + ? businessMessagingIdentityPayload(event) + : nonMessagingIdentityPayload(event)), ...buildCustomData(event), ...buildDataProcessingOptions(event), }) @@ -195,6 +278,7 @@ export const sendConversionEvent = ({ accessToken, version = DEFAULT_API_VERSION, event, + testEventCode, }: SendConversionEventInput): Promise => rescueMetaConversions(async () => { const response = await metaConversionsGraphClient.post( @@ -204,6 +288,7 @@ export const sendConversionEvent = ({ json: { data: [buildConversionEventPayload(event)], partner_agent: META_CONVERSIONS_PARTNER_AGENT, + ...(testEventCode ? { test_event_code: testEventCode } : {}), }, }, ) diff --git a/integrations/meta-conversions/src/schemas.ts b/integrations/meta-conversions/src/schemas.ts index fa1a733dbf..ddb3503792 100644 --- a/integrations/meta-conversions/src/schemas.ts +++ b/integrations/meta-conversions/src/schemas.ts @@ -7,5 +7,7 @@ export const metaMessagingChannelSchema = z.enum([ ]) export type MetaMessagingChannel = z.infer -export const metaCapiEventNameSchema = z.enum(["LeadSubmitted", "Purchase"]) -export type MetaCapiEventName = z.infer +export { + type MetaCapiEventName, + metaCapiEventNameSchema, +} from "@chatbotx.io/utils/meta-capi" diff --git a/packages/business/__tests__/automation-throttle.test.ts b/packages/business/__tests__/automation-throttle.test.ts index 289624dbef..507f68168e 100644 --- a/packages/business/__tests__/automation-throttle.test.ts +++ b/packages/business/__tests__/automation-throttle.test.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest" // --------------------------------------------------------------------------- // automationThrottleService — generic Redis fast-path + Postgres -// source-of-truth throttle claim (docs/plans/default-reply-throttle-hybrid.md). +// source-of-truth throttle claim. // Verifies: acquired/denied/bypassed, DB-computed remaining incl. the denied // branch, window-in-key setting changes, Redis-down → DB, DB-down → fail // open, release delete-by-claimId + Redis best-effort delete, and diff --git a/packages/business/__tests__/contact-custom-field-bot-routing.test.ts b/packages/business/__tests__/contact-custom-field-bot-routing.test.ts index e901298fa5..a83e1f89c8 100644 --- a/packages/business/__tests__/contact-custom-field-bot-routing.test.ts +++ b/packages/business/__tests__/contact-custom-field-bot-routing.test.ts @@ -8,7 +8,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest" // is true AND the keyword is a well-formed `bot_field:` token does the // call delegate to `botFieldService`; every other combination (flag off, or // a plain id/name even with the flag on) must run the EXISTING contact-scoped -// path untouched. See docs/plans/2026-08-28-account-fields-custom-fields-page.md §3.2. +// path untouched. // --------------------------------------------------------------------------- const mocks = vi.hoisted(() => ({ diff --git a/packages/business/__tests__/default-reply-throttle.test.ts b/packages/business/__tests__/default-reply-throttle.test.ts index d6fa53e9a6..10a33c0974 100644 --- a/packages/business/__tests__/default-reply-throttle.test.ts +++ b/packages/business/__tests__/default-reply-throttle.test.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest" // --------------------------------------------------------------------------- // defaultReplyThrottleService — thin default-reply-facing facade over the -// generic automationThrottleService (docs/plans/default-reply-throttle-hybrid.md). +// generic automationThrottleService. // Verifies: the frequency->window map (`allTime` -> 0, the unbounded // record-and-allow window), delegation to the generic service with the fixed // throttleType/subjectId pinned by the wrapper, and `release` threading both diff --git a/packages/business/__tests__/meta-conversions-channel-policy.test.ts b/packages/business/__tests__/meta-conversions-channel-policy.test.ts new file mode 100644 index 0000000000..1f11807edf --- /dev/null +++ b/packages/business/__tests__/meta-conversions-channel-policy.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, test } from "vitest" +import { + capiEventDedupsPerUtcDay, + capiEventRequiresCtwaClid, +} from "../src/meta-conversions/channel-policy" + +describe("CAPI channel identity policy", () => { + test.each([ + ["whatsapp", "business_messaging", true], + ["whatsapp", "email", false], + ["messenger", "business_messaging", false], + ["instagram", "business_messaging", false], + ] as const)("%s + %s requires ctwa_clid: %s", (channel, actionSource, expected) => { + expect(capiEventRequiresCtwaClid(channel, actionSource)).toBe(expected) + expect(capiEventDedupsPerUtcDay(channel, actionSource)).toBe(expected) + }) +}) diff --git a/packages/business/__tests__/meta-conversions-service.test.ts b/packages/business/__tests__/meta-conversions-service.test.ts index 909183aeec..476511a0b8 100644 --- a/packages/business/__tests__/meta-conversions-service.test.ts +++ b/packages/business/__tests__/meta-conversions-service.test.ts @@ -18,6 +18,8 @@ const mocks = vi.hoisted(() => ({ messengerUpdateCapiScopeCache: vi.fn(), messengerUpdateDatasetIdIfNull: vi.fn(), messengerUpdateDatasetId: vi.fn(), + messengerUpdateCapiTestEventCode: vi.fn(), + findMostRecentByInbox: vi.fn(), messengerUpdateCapiAccessToken: vi.fn(), messengerClearCapiAccessToken: vi.fn(), instagramFindWorkspaceIntegration: vi.fn(), @@ -52,7 +54,11 @@ vi.mock("@chatbotx.io/database/repositories", () => ({ insertIgnoreDuplicate: mocks.insertIgnoreDuplicate, updateCapiStatus: mocks.metaCapiUpdateCapiStatus, }, + contactInboxRepository: { + findMostRecentByInbox: mocks.findMostRecentByInbox, + }, integrationMessengerRepository: { + updateCapiTestEventCode: mocks.messengerUpdateCapiTestEventCode, findWorkspaceIntegration: mocks.messengerFindWorkspaceIntegration, claimCapiScopeCacheRefresh: mocks.messengerClaimCapiScopeCacheRefresh, updateCapiScopeCache: mocks.messengerUpdateCapiScopeCache, @@ -172,6 +178,9 @@ const whatsappIntegration = { capiAccessToken: null, } +// `test:::` — see `buildSourceKey`. +const TEST_SOURCE_KEY_PATTERN = /^test:[^:]+:ci-9:/ + describe("MetaConversionsService", () => { beforeEach(() => { vi.clearAllMocks() @@ -309,7 +318,7 @@ describe("MetaConversionsService", () => { }) await expect( - metaConversionsService.enqueueLeadEvent({ + metaConversionsService.enqueueEvent({ workspaceId: "ws-1", channel: "messenger", contactInboxId: "ci-1", @@ -344,7 +353,7 @@ describe("MetaConversionsService", () => { test("inserts a new event and enqueues one send job", async () => { await expect( - metaConversionsService.enqueueLeadEvent({ + metaConversionsService.enqueueEvent({ workspaceId: "ws-1", channel: "messenger", contactInboxId: "ci-1", @@ -377,7 +386,7 @@ describe("MetaConversionsService", () => { }) test("persists optional value and normalized currency on inserted events", async () => { - await metaConversionsService.enqueueLeadEvent({ + await metaConversionsService.enqueueEvent({ workspaceId: "ws-1", channel: "messenger", contactInboxId: "ci-1", @@ -397,11 +406,59 @@ describe("MetaConversionsService", () => { ) }) + test("defaults eventName and actionSource on the inserted row when omitted", async () => { + await metaConversionsService.enqueueEvent({ + workspaceId: "ws-1", + channel: "messenger", + contactInboxId: "ci-1", + inboxId: "inbox-1", + sourceKey: "flow:step-1:ci-1:20260810", + source: "flowStep", + occurredAt: new Date("2026-08-10T12:00:00.000Z"), + }) + + expect(mocks.insertIgnoreDuplicate).toHaveBeenCalledWith( + expect.objectContaining({ + eventName: "LeadSubmitted", + actionSource: "business_messaging", + contentType: null, + contentIds: null, + }), + ) + }) + + test("writes actionSource, contentType, and contentIds on the inserted row", async () => { + await metaConversionsService.enqueueEvent({ + workspaceId: "ws-1", + channel: "messenger", + contactInboxId: "ci-1", + inboxId: "inbox-1", + sourceKey: "flow:step-1:ci-1:20260810", + source: "flowStep", + eventName: "Purchase", + actionSource: "email", + contentType: "product", + contentIds: "sku-1, sku-2", + value: "19.99", + currency: "usd", + occurredAt: new Date("2026-08-10T12:00:00.000Z"), + }) + + expect(mocks.insertIgnoreDuplicate).toHaveBeenCalledWith( + expect.objectContaining({ + eventName: "Purchase", + actionSource: "email", + contentType: "product", + contentIds: ["sku-1", "sku-2"], + }), + ) + }) + test("does not enqueue when an existing event is no longer pending", async () => { mocks.insertIgnoreDuplicate.mockResolvedValueOnce(null) mocks.findPendingBySourceKey.mockResolvedValueOnce(null) - await metaConversionsService.enqueueLeadEvent({ + await metaConversionsService.enqueueEvent({ workspaceId: "ws-1", channel: "messenger", contactInboxId: "ci-1", @@ -419,7 +476,7 @@ describe("MetaConversionsService", () => { ) await expect( - metaConversionsService.enqueueLeadEvent({ + metaConversionsService.enqueueEvent({ workspaceId: "ws-other", channel: "messenger", contactInboxId: "ci-1", @@ -609,7 +666,7 @@ describe("MetaConversionsService", () => { test("resolves the whatsapp integration by inbox when enqueuing a lead event", async () => { await expect( - metaConversionsService.enqueueLeadEvent({ + metaConversionsService.enqueueEvent({ workspaceId: "ws-1", channel: "whatsapp", contactInboxId: "ci-1", @@ -936,15 +993,278 @@ describe("MetaConversionsService", () => { ) }) - describe("buildLeadSourceKey", () => { + describe("provisionDatasetNow", () => { + test("overwrites a stale stored dataset id when Meta returns a different one", async () => { + mocks.messengerUpdateDatasetId.mockResolvedValueOnce({ + ...messengerIntegration, + datasetId: "new", + }) + const provisionDataset = vi.fn().mockResolvedValue("new") + + await expect( + metaConversionsService.provisionDatasetNow({ + channel: "messenger", + integration: { ...messengerIntegration, datasetId: "old" }, + provisionDataset, + }), + ).resolves.toBe("new") + + expect(mocks.messengerUpdateDatasetId).toHaveBeenCalledWith( + { + id: "im-1", + workspaceId: "ws-1", + datasetId: "new", + }, + undefined, + ) + expect(mocks.messengerUpdateDatasetIdIfNull).not.toHaveBeenCalled() + }) + + test("does not write when Meta returns the same dataset id already stored", async () => { + const provisionDataset = vi.fn().mockResolvedValue("same") + + await expect( + metaConversionsService.provisionDatasetNow({ + channel: "messenger", + integration: { ...messengerIntegration, datasetId: "same" }, + provisionDataset, + }), + ).resolves.toBe("same") + + // Meta is always asked — a stored id alone must never short-circuit this path. + expect(provisionDataset).toHaveBeenCalledTimes(1) + expect(mocks.messengerUpdateDatasetId).not.toHaveBeenCalled() + expect(mocks.messengerUpdateDatasetIdIfNull).not.toHaveBeenCalled() + }) + + test("provisions a dataset when none is stored yet", async () => { + mocks.messengerUpdateDatasetId.mockResolvedValueOnce({ + ...messengerIntegration, + datasetId: "fresh", + }) + const provisionDataset = vi.fn().mockResolvedValue("fresh") + + await expect( + metaConversionsService.provisionDatasetNow({ + channel: "messenger", + integration: messengerIntegration, + provisionDataset, + }), + ).resolves.toBe("fresh") + + expect(mocks.messengerUpdateDatasetId).toHaveBeenCalledWith( + { + id: "im-1", + workspaceId: "ws-1", + datasetId: "fresh", + }, + undefined, + ) + }) + + test("propagates a Meta error without writing the dataset id", async () => { + const provisionDataset = vi + .fn() + .mockRejectedValue(new Error("dataset create failed")) + + await expect( + metaConversionsService.provisionDatasetNow({ + channel: "messenger", + integration: { ...messengerIntegration, datasetId: "old" }, + provisionDataset, + }), + ).rejects.toThrow("dataset create failed") + + expect(mocks.messengerUpdateDatasetId).not.toHaveBeenCalled() + expect(mocks.messengerUpdateDatasetIdIfNull).not.toHaveBeenCalled() + }) + + test("retries whatsapp dataset provisioning with the fallback token on an auth error", async () => { + mocks.whatsappUpdateDatasetId.mockResolvedValueOnce({ + ...whatsappIntegration, + datasetId: "dataset-waba-2", + }) + mocks.whatsappResolveDatasetCreationTokens.mockResolvedValue({ + primaryToken: "wa-system-token", + fallbackToken: "whatsapp-token", + }) + // The System User token is rejected (#100), so the create is retried + // with the connect token — the "Create Dataset" path shares the same + // fallback mechanics as the lazy send-path provisioning. + const provisionDataset = vi + .fn() + .mockRejectedValueOnce( + Object.assign(new Error("(#100) Missing Permission"), { + code: 100, + httpStatusCode: 400, + }), + ) + .mockResolvedValueOnce("dataset-waba-2") + + await expect( + metaConversionsService.provisionDatasetNow({ + channel: "whatsapp", + integration: { ...whatsappIntegration, datasetId: "old-waba" }, + provisionDataset, + }), + ).resolves.toBe("dataset-waba-2") + + expect(provisionDataset).toHaveBeenNthCalledWith(1, { + accessToken: "wa-system-token", + fallbackAccessToken: "whatsapp-token", + resourceId: "waba-1", + resourceName: "Acme WABA", + }) + expect(provisionDataset).toHaveBeenNthCalledWith(2, { + accessToken: "whatsapp-token", + fallbackAccessToken: "whatsapp-token", + resourceId: "waba-1", + resourceName: "Acme WABA", + }) + expect(mocks.whatsappUpdateDatasetId).toHaveBeenCalledWith( + { + id: "wa-1", + workspaceId: "ws-1", + datasetId: "dataset-waba-2", + }, + undefined, + ) + }) + }) + + describe("test events", () => { + test("saveCapiTestEventCode trims and stores the code", async () => { + mocks.messengerUpdateCapiTestEventCode.mockResolvedValue({ + ...messengerIntegration, + capiTestEventCode: "TEST33520", + }) + + await expect( + metaConversionsService.saveCapiTestEventCode({ + channel: "messenger", + integration: messengerIntegration, + testEventCode: " TEST33520 ", + }), + ).resolves.toEqual( + expect.objectContaining({ capiTestEventCode: "TEST33520" }), + ) + expect(mocks.messengerUpdateCapiTestEventCode).toHaveBeenCalledWith( + { id: "im-1", workspaceId: "ws-1", capiTestEventCode: "TEST33520" }, + undefined, + ) + }) + + test("saveCapiTestEventCode with null clears the code", async () => { + mocks.messengerUpdateCapiTestEventCode.mockResolvedValue( + messengerIntegration, + ) + + await metaConversionsService.saveCapiTestEventCode({ + channel: "messenger", + integration: messengerIntegration, + testEventCode: null, + }) + + expect(mocks.messengerUpdateCapiTestEventCode).toHaveBeenCalledWith( + { id: "im-1", workspaceId: "ws-1", capiTestEventCode: null }, + undefined, + ) + }) + + test("saveCapiTestEventCode rejects a code with unexpected characters", async () => { + await expect( + metaConversionsService.saveCapiTestEventCode({ + channel: "messenger", + integration: messengerIntegration, + testEventCode: "TEST 123;", + }), + ).rejects.toThrow() + expect(mocks.messengerUpdateCapiTestEventCode).not.toHaveBeenCalled() + }) + + test("enqueueTestEvent refuses to run without a saved test code", async () => { + await expect( + metaConversionsService.enqueueTestEvent({ + channel: "messenger", + integration: messengerIntegration, + }), + ).rejects.toMatchObject({ + name: "CapiTestEventError", + reason: "testEventCodeRequired", + }) + expect(mocks.insertIgnoreDuplicate).not.toHaveBeenCalled() + }) + + test("enqueueTestEvent fails clearly when the inbox has no contact yet", async () => { + mocks.findMostRecentByInbox.mockResolvedValue(null) + + await expect( + metaConversionsService.enqueueTestEvent({ + channel: "messenger", + integration: { ...messengerIntegration, capiTestEventCode: "TEST1" }, + }), + ).rejects.toMatchObject({ reason: "noContactForTest" }) + expect(mocks.insertIgnoreDuplicate).not.toHaveBeenCalled() + }) + + test("enqueueTestEvent queues one sample Purchase for the inbox's most recent contact", async () => { + mocks.findMostRecentByInbox.mockResolvedValue({ + id: "ci-9", + channel: "messenger", + inboxId: "inbox-1", + }) + + const event = await metaConversionsService.enqueueTestEvent({ + channel: "messenger", + integration: { ...messengerIntegration, capiTestEventCode: "TEST1" }, + }) + + expect(mocks.findMostRecentByInbox).toHaveBeenCalledWith({ + inboxId: "inbox-1", + workspaceId: "ws-1", + requireCtwaClid: false, + }) + expect(event).toEqual( + expect.objectContaining({ + source: "manualTest", + contactInboxId: "ci-9", + eventName: "Purchase", + actionSource: "business_messaging", + value: "100", + currency: "USD", + }), + ) + expect(event?.sourceKey).toMatch(TEST_SOURCE_KEY_PATTERN) + expect(mocks.enqueueIntegrationJob).toHaveBeenCalledTimes(1) + }) + }) + + describe("test events on WhatsApp", () => { + test("enqueueTestEvent only considers click-to-WhatsApp-attributed contacts", async () => { + mocks.findMostRecentByInbox.mockResolvedValue(null) + + await expect( + metaConversionsService.enqueueTestEvent({ + channel: "whatsapp", + integration: { ...whatsappIntegration, capiTestEventCode: "TEST1" }, + }), + ).rejects.toMatchObject({ reason: "noContactForTest" }) + + expect(mocks.findMostRecentByInbox).toHaveBeenCalledWith( + expect.objectContaining({ requireCtwaClid: true }), + ) + }) + }) + + describe("buildSourceKey", () => { test("whatsapp dedups per contact per UTC day (identical key within a day)", () => { - const first = metaConversionsService.buildLeadSourceKey({ + const first = metaConversionsService.buildSourceKey({ scope: "flow", scopeId: "s1", contactInboxId: "c1", channel: "whatsapp", }) - const second = metaConversionsService.buildLeadSourceKey({ + const second = metaConversionsService.buildSourceKey({ scope: "flow", scopeId: "s1", contactInboxId: "c1", @@ -955,20 +1275,57 @@ describe("MetaConversionsService", () => { expect(first).toMatch(WHATSAPP_FLOW_SOURCE_KEY_PATTERN) }) + test("whatsapp under a non-messaging action source never dedups (hashed identity, no CTWA cap)", () => { + const first = metaConversionsService.buildSourceKey({ + scope: "flow", + scopeId: "s1", + contactInboxId: "c1", + channel: "whatsapp", + actionSource: "email", + }) + const second = metaConversionsService.buildSourceKey({ + scope: "flow", + scopeId: "s1", + contactInboxId: "c1", + channel: "whatsapp", + actionSource: "email", + }) + + expect(first).not.toBe(second) + }) + + test("whatsapp with an explicit business_messaging action source dedups like the default", () => { + const explicit = metaConversionsService.buildSourceKey({ + scope: "flow", + scopeId: "s1", + contactInboxId: "c1", + channel: "whatsapp", + actionSource: "business_messaging", + }) + const implicit = metaConversionsService.buildSourceKey({ + scope: "flow", + scopeId: "s1", + contactInboxId: "c1", + channel: "whatsapp", + }) + + expect(explicit).toBe(implicit) + }) + test("messenger and instagram never dedup (a unique key per fire)", () => { - const messengerFirst = metaConversionsService.buildLeadSourceKey({ + const messengerFirst = metaConversionsService.buildSourceKey({ scope: "trigger", scopeId: "t1", contactInboxId: "c1", channel: "messenger", }) - const messengerSecond = metaConversionsService.buildLeadSourceKey({ + const messengerSecond = metaConversionsService.buildSourceKey({ scope: "trigger", scopeId: "t1", contactInboxId: "c1", channel: "messenger", }) - const instagram = metaConversionsService.buildLeadSourceKey({ + const instagram = metaConversionsService.buildSourceKey({ scope: "flow", scopeId: "s1", contactInboxId: "c1", diff --git a/packages/business/src/automation-throttle/service.ts b/packages/business/src/automation-throttle/service.ts index 1f3b1c731c..85d0f6f876 100644 --- a/packages/business/src/automation-throttle/service.ts +++ b/packages/business/src/automation-throttle/service.ts @@ -10,8 +10,7 @@ import { logger } from "../logger" /** * Redis fast-path marker TTL cap (seconds). Postgres remains the source of * truth for the real window; this only bounds how long a stale marker can - * live before it self-expires and the next lookup re-consults Postgres. See - * `docs/plans/default-reply-throttle-hybrid.md`. + * live before it self-expires and the next lookup re-consults Postgres. */ export const AUTOMATION_THROTTLE_FASTPATH_TTL_SECONDS = 300 diff --git a/packages/business/src/contact-custom-field/service.ts b/packages/business/src/contact-custom-field/service.ts index a403d45ed4..6488ed37c2 100644 --- a/packages/business/src/contact-custom-field/service.ts +++ b/packages/business/src/contact-custom-field/service.ts @@ -98,7 +98,7 @@ type DeleteByKeyInput = { * `bot_field:` reference token, delegate to `botFieldService` instead * of the contact-scoped lookup below. Default-false keeps every existing * caller (including the public workspace-token contact endpoints) unable - * to reach Account Fields — see `docs/plans/2026-08-28-account-fields-custom-fields-page.md` §3.2. + * to reach Account Fields. */ allowBotFields?: boolean } diff --git a/packages/business/src/default-reply/throttle.ts b/packages/business/src/default-reply/throttle.ts index de2748c237..7ab10fb7e3 100644 --- a/packages/business/src/default-reply/throttle.ts +++ b/packages/business/src/default-reply/throttle.ts @@ -30,8 +30,7 @@ export type DefaultReplyThrottleClaimResult = AutomationThrottleClaim["result"] /** * Thin default-reply-facing facade over the generic - * {@link automationThrottleService} (see - * `docs/plans/default-reply-throttle-hybrid.md`). Pins `throttleType: + * {@link automationThrottleService}. Pins `throttleType: * "defaultReply"` and `subjectId: "0"`, and translates the workspace's * configured {@link DefaultReplyFrequency} into `windowSeconds` (`allTime` → the * unbounded `0` window) — keeping the worker call site frequency-based. diff --git a/packages/business/src/meta-conversions/__tests__/event-input.test.ts b/packages/business/src/meta-conversions/__tests__/event-input.test.ts new file mode 100644 index 0000000000..dba62acc4a --- /dev/null +++ b/packages/business/src/meta-conversions/__tests__/event-input.test.ts @@ -0,0 +1,150 @@ +import { describe, expect, test } from "vitest" +import { splitContentIds } from "../event-input" +import { enqueueEventInput } from "../schema" + +// `enqueueEventInput` validates a value/currency/contentIds that a worker has +// already resolved from templates, so it must never itself perform +// destructive normalization ("12,50" is ambiguous between 12.50 and 1250, so +// it is rejected, not silently reinterpreted) and must reject an unresolved +// `{{...}}` template that leaked through. + +function baseInput(overrides: Partial> = {}) { + return { + workspaceId: "ws-1", + channel: "messenger", + contactInboxId: "ci-1", + inboxId: "inbox-1", + sourceKey: "flow:step-1:ci-1:key", + source: "flowStep", + ...overrides, + } +} + +describe("enqueueEventInput — value", () => { + test.each([ + "1250000", + "12.5", + ])("accepts canonical numeric value %s", (value) => { + const result = enqueueEventInput.parse(baseInput({ value })) + expect(result.value).toBe(value) + }) + + test("trims surrounding whitespace without altering digits", () => { + const result = enqueueEventInput.parse(baseInput({ value: " 12.50 " })) + expect(result.value).toBe("12.50") + }) + + test.each([ + ["12,50", "comma decimal separator"], + ["1,250", "comma thousands separator"], + ["$12", "currency symbol"], + ["{{x}}", "unresolved template placeholder"], + ])("rejects %s (%s)", (value) => { + expect(() => enqueueEventInput.parse(baseInput({ value }))).toThrow() + }) +}) + +describe("enqueueEventInput — currency", () => { + test("trims and uppercases a valid ISO-4217 code", () => { + const result = enqueueEventInput.parse(baseInput({ currency: " vnd " })) + expect(result.currency).toBe("VND") + }) + + test("rejects a code that is not exactly 3 letters", () => { + expect(() => + enqueueEventInput.parse(baseInput({ currency: "VN" })), + ).toThrow() + }) +}) + +describe("splitContentIds", () => { + test("splits, trims, and drops empty segments", () => { + expect(splitContentIds("a, b ,,c")).toEqual(["a", "b", "c"]) + }) + + test("returns undefined for an empty string", () => { + expect(splitContentIds("")).toBeUndefined() + }) + + test("returns undefined for a blank string", () => { + expect(splitContentIds(" ")).toBeUndefined() + }) +}) + +describe("enqueueEventInput — contentIds preprocessing", () => { + test("parses a comma-separated string into a string[]", () => { + const result = enqueueEventInput.parse( + baseInput({ contentIds: "a, b ,,c" }), + ) + expect(result.contentIds).toEqual(["a", "b", "c"]) + }) + + test("omits contentIds when the input is blank", () => { + const result = enqueueEventInput.parse(baseInput({ contentIds: "" })) + expect(result.contentIds).toBeUndefined() + }) +}) + +describe("enqueueEventInput — Purchase value/currency requirement", () => { + test("rejects Purchase without value", () => { + expect(() => + enqueueEventInput.parse( + baseInput({ eventName: "Purchase", currency: "USD" }), + ), + ).toThrow() + }) + + test("rejects Purchase without currency", () => { + expect(() => + enqueueEventInput.parse( + baseInput({ eventName: "Purchase", value: "9.99" }), + ), + ).toThrow() + }) + + test("accepts Purchase with both value and currency", () => { + const result = enqueueEventInput.parse( + baseInput({ eventName: "Purchase", value: "9.99", currency: "USD" }), + ) + expect(result).toMatchObject({ + eventName: "Purchase", + value: "9.99", + currency: "USD", + }) + }) + + test("accepts LeadSubmitted without value or currency", () => { + const result = enqueueEventInput.parse( + baseInput({ eventName: "LeadSubmitted" }), + ) + expect(result.eventName).toBe("LeadSubmitted") + }) +}) + +describe("enqueueEventInput — event catalog per action source", () => { + test("rejects a custom event name for business_messaging", () => { + expect(() => + enqueueEventInput.parse( + baseInput({ + actionSource: "business_messaging", + eventName: "MyCustomEvent", + }), + ), + ).toThrow() + }) + + test("accepts a custom event name for a pixel-catalog action source", () => { + const result = enqueueEventInput.parse( + baseInput({ actionSource: "email", eventName: "MyCustomEvent" }), + ) + expect(result.eventName).toBe("MyCustomEvent") + }) +}) + +describe("enqueueEventInput — defaults", () => { + test("defaults eventName and actionSource when omitted", () => { + const result = enqueueEventInput.parse(baseInput()) + expect(result.eventName).toBe("LeadSubmitted") + expect(result.actionSource).toBe("business_messaging") + }) +}) diff --git a/packages/business/src/meta-conversions/adapters/instagram.ts b/packages/business/src/meta-conversions/adapters/instagram.ts index 952b0ff2bd..a81ecda38d 100644 --- a/packages/business/src/meta-conversions/adapters/instagram.ts +++ b/packages/business/src/meta-conversions/adapters/instagram.ts @@ -51,6 +51,8 @@ export const instagramCapiReadinessAdapter: CapiReadinessAdapter<"instagram"> = integrationInstagramRepository.updateDatasetIdIfNull(input, tx), updateDatasetId: (input, tx) => integrationInstagramRepository.updateDatasetId(input, tx), + updateCapiTestEventCode: (input, tx) => + integrationInstagramRepository.updateCapiTestEventCode(input, tx), updateCapiAccessToken: (input, tx) => integrationInstagramRepository.updateCapiAccessToken(input, tx), connectCustomCapi: (input, tx) => diff --git a/packages/business/src/meta-conversions/adapters/messenger.ts b/packages/business/src/meta-conversions/adapters/messenger.ts index a185ed9ba9..e809ad0bba 100644 --- a/packages/business/src/meta-conversions/adapters/messenger.ts +++ b/packages/business/src/meta-conversions/adapters/messenger.ts @@ -41,6 +41,8 @@ export const messengerCapiReadinessAdapter: CapiReadinessAdapter<"messenger"> = integrationMessengerRepository.updateDatasetIdIfNull(input, tx), updateDatasetId: (input, tx) => integrationMessengerRepository.updateDatasetId(input, tx), + updateCapiTestEventCode: (input, tx) => + integrationMessengerRepository.updateCapiTestEventCode(input, tx), updateCapiAccessToken: (input, tx) => integrationMessengerRepository.updateCapiAccessToken(input, tx), connectCustomCapi: (input, tx) => diff --git a/packages/business/src/meta-conversions/adapters/types.ts b/packages/business/src/meta-conversions/adapters/types.ts index 3334006e4d..963cc2fb97 100644 --- a/packages/business/src/meta-conversions/adapters/types.ts +++ b/packages/business/src/meta-conversions/adapters/types.ts @@ -28,6 +28,10 @@ type DatasetIdUpdate = WorkspaceIntegrationRef & { datasetId: string } +type CapiTestEventCodeUpdate = WorkspaceIntegrationRef & { + capiTestEventCode: string | null +} + type CapiCustomConnect = WorkspaceIntegrationRef & { datasetId: string capiAccessToken: EncryptedData @@ -73,6 +77,11 @@ export interface CapiSendAdapter< input: CapiScopeCacheUpdate, tx?: DatabaseClient, ): Promise + /** Set or clear (null) the Events Manager test_event_code. */ + updateCapiTestEventCode( + input: CapiTestEventCodeUpdate, + tx?: DatabaseClient, + ): Promise /** * Unconditional write — every channel supports overwriting a * user-entered dataset id (distinct from the lazy `updateDatasetIdIfNull` diff --git a/packages/business/src/meta-conversions/adapters/whatsapp.ts b/packages/business/src/meta-conversions/adapters/whatsapp.ts index 2b6f61831d..c045ce3f9d 100644 --- a/packages/business/src/meta-conversions/adapters/whatsapp.ts +++ b/packages/business/src/meta-conversions/adapters/whatsapp.ts @@ -61,6 +61,8 @@ export const whatsappCapiReadinessAdapter: CapiReadinessAdapter<"whatsapp"> = { integrationWhatsappRepository.updateCapiScopeCache(input, tx), updateDatasetId: (input, tx) => integrationWhatsappRepository.updateDatasetId(input, tx), + updateCapiTestEventCode: (input, tx) => + integrationWhatsappRepository.updateCapiTestEventCode(input, tx), updateDatasetIdIfNull: (input, tx) => integrationWhatsappRepository.updateDatasetIdIfNull(input, tx), updateCapiAccessToken: (input, tx) => diff --git a/packages/business/src/meta-conversions/channel-policy.ts b/packages/business/src/meta-conversions/channel-policy.ts new file mode 100644 index 0000000000..183039cac5 --- /dev/null +++ b/packages/business/src/meta-conversions/channel-policy.ts @@ -0,0 +1,44 @@ +import { + type MetaCapiActionSource, + metaCapiActionSourcePolicy, +} from "@chatbotx.io/utils/meta-capi" +import type { MetaConversionsChannel } from "./schema" + +type ChannelIdentityRules = { + /** Meta only accepts the event when the contact carries a click-to-ad id. */ + requiresCtwaClid: boolean + /** Meta caps CAPI at one event per ad, so one event per contact per UTC day. */ + dedupsPerUtcDay: boolean +} + +/** + * Per-channel rules for events sent with the messaging identity. WhatsApp + * business-messaging events are keyed to the click-to-WhatsApp ad + * (`ctwa_clid`); Messenger and Instagram have no such constraint. Every + * channel-specific branch on the CAPI send/dedup path reads this map instead + * of comparing channel literals. + */ +const channelIdentityRules = { + messenger: { requiresCtwaClid: false, dedupsPerUtcDay: false }, + instagram: { requiresCtwaClid: false, dedupsPerUtcDay: false }, + whatsapp: { requiresCtwaClid: true, dedupsPerUtcDay: true }, +} as const satisfies Record + +const usesMessagingIdentity = (actionSource: MetaCapiActionSource): boolean => + metaCapiActionSourcePolicy[actionSource].usesMessagingIdentity + +/** Whether an event on this channel/action source needs a `ctwa_clid` to be sendable. */ +export const capiEventRequiresCtwaClid = ( + channel: MetaConversionsChannel, + actionSource: MetaCapiActionSource, +): boolean => + channelIdentityRules[channel].requiresCtwaClid && + usesMessagingIdentity(actionSource) + +/** Whether an event on this channel/action source dedups per contact per UTC day. */ +export const capiEventDedupsPerUtcDay = ( + channel: MetaConversionsChannel, + actionSource: MetaCapiActionSource, +): boolean => + channelIdentityRules[channel].dedupsPerUtcDay && + usesMessagingIdentity(actionSource) diff --git a/packages/business/src/meta-conversions/event-input.ts b/packages/business/src/meta-conversions/event-input.ts new file mode 100644 index 0000000000..d1641d0c3c --- /dev/null +++ b/packages/business/src/meta-conversions/event-input.ts @@ -0,0 +1,27 @@ +/** + * Pure helpers backing `enqueueEventInput` (see `schema.ts`). Kept + * dependency-free so the parsing rule is unit-testable in isolation from the + * schema's cross-field `superRefine` checks. + */ + +/** + * Splits a comma-separated Meta `content_ids` string (e.g. `"123, 456"`) + * into a trimmed, non-empty `string[]`. Blank segments (`"a,,b"`) are + * dropped. An empty/blank input — or anything that is not a string, e.g. a + * caller that already passes an array — returns `undefined` rather than an + * empty array, so "not set" stays `undefined` end to end. Used as the + * `z.preprocess` step ahead of `z.array(z.string().min(1)).min(1).optional()` + * in `enqueueEventInput`. + */ +export function splitContentIds(value: unknown): unknown { + if (typeof value !== "string") { + return value + } + + const ids = value + .split(",") + .map((id) => id.trim()) + .filter((id) => id.length > 0) + + return ids.length > 0 ? ids : undefined +} diff --git a/packages/business/src/meta-conversions/index.ts b/packages/business/src/meta-conversions/index.ts index a1610aca9f..5f8cb539c4 100644 --- a/packages/business/src/meta-conversions/index.ts +++ b/packages/business/src/meta-conversions/index.ts @@ -1,3 +1,4 @@ +export * from "./channel-policy" export * from "./hash-user-data" export * from "./schema" export * from "./service" diff --git a/packages/business/src/meta-conversions/schema.ts b/packages/business/src/meta-conversions/schema.ts index 4d1e0e5460..47d769100d 100644 --- a/packages/business/src/meta-conversions/schema.ts +++ b/packages/business/src/meta-conversions/schema.ts @@ -1,6 +1,5 @@ import { metaCapiEventChannelSchema, - metaCapiEventNameSchema, metaCapiEventSourceSchema, metaCapiStatusSchema, } from "@chatbotx.io/database/schema" @@ -10,37 +9,64 @@ import type { IntegrationWhatsappModel, MetaCapiEventModel, } from "@chatbotx.io/database/types" +import { withMetaCapiEventRefinements } from "@chatbotx.io/flow-config" +import { + defaultMetaCapiActionSource, + metaCapiActionSourceSchema, + metaCapiContentTypeSchema, + metaCapiCurrencySchema, + metaCapiEventNameSchema, + metaCapiValueSchema, +} from "@chatbotx.io/utils/meta-capi" import { z } from "zod" +import { splitContentIds } from "./event-input" const capiDatasetIdSchema = z.string().trim().regex(/^\d+$/) const capiAccessTokenSchema = z.string().trim().min(1) -const capiEventValueSchema = z - .string() - .trim() - .regex(/^\d+(\.\d+)?$/) -const capiEventCurrencySchema = z - .string() - .trim() - .toUpperCase() - .pipe(z.string().regex(/^[A-Z]{3}$/)) - -export const enqueueLeadEventInput = z.object({ - workspaceId: z.string().min(1), - channel: metaCapiEventChannelSchema, - contactInboxId: z.string().min(1), - inboxId: z.string().min(1), - sourceKey: z.string().min(1), - source: metaCapiEventSourceSchema, - value: capiEventValueSchema.optional(), - currency: capiEventCurrencySchema.optional(), - contentCategory: z.string().trim().min(1).max(200).optional(), - contentName: z.string().trim().min(1).max(200).optional(), - occurredAt: z.date().optional(), -}) +/** + * Business-boundary input for enqueuing a Meta CAPI event, shared by the + * flow-step handler and the trigger executor — both resolve any + * `{{variable}}` templates first, then parse the resolved fields here. + * `eventName`/`actionSource` default the same way the flow-config field + * schema does, so a caller that omits them still produces today's + * LeadSubmitted / business_messaging row. The Purchase cross-field rule and + * the action-source event catalog are the exact same refinements the + * flow/trigger schemas use — reused, not re-implemented. + */ +export const enqueueEventInput = withMetaCapiEventRefinements( + z.object({ + workspaceId: z.string().min(1), + channel: metaCapiEventChannelSchema, + contactInboxId: z.string().min(1), + inboxId: z.string().min(1), + sourceKey: z.string().min(1), + source: metaCapiEventSourceSchema, + eventName: metaCapiEventNameSchema.default("LeadSubmitted"), + actionSource: metaCapiActionSourceSchema.default( + defaultMetaCapiActionSource, + ), + contentType: metaCapiContentTypeSchema.optional(), + contentIds: z.preprocess( + splitContentIds, + z.array(z.string().min(1)).min(1).optional(), + ), + value: metaCapiValueSchema.optional(), + currency: metaCapiCurrencySchema.optional(), + contentCategory: z.string().trim().min(1).max(200).optional(), + contentName: z.string().trim().min(1).max(200).optional(), + occurredAt: z.date().optional(), + }), +) -export type EnqueueLeadEventInput = z.infer +/** + * `z.input`, not `z.infer`: `eventName`/`actionSource` are `.default()`ed, + * so under `z.infer` (the *output* type) they would be required — which + * would break any caller that omits them and relies on this schema's + * defaults. + */ +export type EnqueueEventInput = z.input -export type MetaConversionsChannel = EnqueueLeadEventInput["channel"] +export type MetaConversionsChannel = EnqueueEventInput["channel"] /** * Channels with a CAPI *connect* UI (custom connection + disconnect). @@ -118,6 +144,35 @@ export type SaveDatasetIdInput< validate: (input: DatasetValidationInput) => Promise } +/** + * Meta issues codes like `TEST12345`; accept any short token so a future + * format change on Meta's side does not lock users out. `null` clears it. + */ +export const saveCapiTestEventCodeInput = z.object({ + testEventCode: z + .string() + .trim() + .min(1) + .max(64) + .regex(/^[A-Za-z0-9_-]+$/) + .nullable(), +}) + +export type SaveCapiTestEventCodeInput< + TChannel extends MetaConversionsChannel = MetaConversionsChannel, +> = { + channel: TChannel + integration: MetaConversionsIntegrationByChannel[TChannel] + testEventCode: string | null +} + +export type EnqueueTestEventInput< + TChannel extends MetaConversionsChannel = MetaConversionsChannel, +> = { + channel: TChannel + integration: MetaConversionsIntegrationByChannel[TChannel] +} + export type ProvisionDatasetNowInput< TChannel extends MetaConversionsChannel = MetaConversionsChannel, > = EnsureDatasetIdInput @@ -163,5 +218,3 @@ export type FindWorkspaceEventInput = Pick< MetaCapiEventModel, "id" | "workspaceId" > - -export const metaCapiEventName = metaCapiEventNameSchema.enum.LeadSubmitted diff --git a/packages/business/src/meta-conversions/service.ts b/packages/business/src/meta-conversions/service.ts index 8ff12f7c52..c78304d7a4 100644 --- a/packages/business/src/meta-conversions/service.ts +++ b/packages/business/src/meta-conversions/service.ts @@ -1,7 +1,14 @@ -import { metaCapiEventRepository } from "@chatbotx.io/database/repositories" +import { + contactInboxRepository, + metaCapiEventRepository, +} from "@chatbotx.io/database/repositories" import type { MetaCapiEventModel } from "@chatbotx.io/database/types" import { encryptUtils } from "@chatbotx.io/encryption" import { createId } from "@chatbotx.io/utils" +import { + defaultMetaCapiActionSource, + type MetaCapiActionSource, +} from "@chatbotx.io/utils/meta-capi" import { enqueueIntegrationJob, IntegrationJobAction, @@ -16,22 +23,28 @@ import { instagramCapiReadinessAdapter } from "./adapters/instagram" import { messengerCapiReadinessAdapter } from "./adapters/messenger" import type { CapiReadinessAdapter, CapiSendAdapter } from "./adapters/types" import { whatsappCapiReadinessAdapter } from "./adapters/whatsapp" +import { + capiEventDedupsPerUtcDay, + capiEventRequiresCtwaClid, +} from "./channel-policy" import { createDatasetWithFallback } from "./dataset-fallback" import { type CapiConnectChannel, type ClearCapiAccessTokenInput, - type EnqueueLeadEventInput, + type EnqueueEventInput, + type EnqueueTestEventInput, type EnsureDatasetIdInput, - enqueueLeadEventInput, + enqueueEventInput, type FindWorkspaceEventInput, type MetaConversionsChannel, type MetaConversionsIntegrationByChannel, - metaCapiEventName, type ProvisionDatasetNowInput, type RefreshCapiScopeCacheInput, type SaveCapiAccessTokenInput, + type SaveCapiTestEventCodeInput, type SaveDatasetIdInput, saveCapiAccessTokenInput, + saveCapiTestEventCodeInput, saveDatasetIdInput, type UpdateCapiStatusInput, updateCapiStatusInput, @@ -49,6 +62,29 @@ export class CapiScopeRefreshError extends Error { } } +/** A "Send test event" precondition the CAPI settings tab must surface. */ +export type CapiTestEventErrorReason = + | "testEventCodeRequired" + | "noContactForTest" + +export class CapiTestEventError extends Error { + readonly reason: CapiTestEventErrorReason + + constructor(reason: CapiTestEventErrorReason, options?: ErrorOptions) { + super(reason, options) + this.name = "CapiTestEventError" + this.reason = reason + } +} + +/** Fixed sample event for "Send test event": what Meta's own Test Events sample uses. */ +const capiTestEventSample = { + eventName: "Purchase", + actionSource: defaultMetaCapiActionSource, + value: "100", + currency: "USD", +} as const + // Send-path adapters: all 3 channels. Used by every method that runs on the // worker send path or the lazy scope-refresh/dataset-provisioning paths. const capiSendAdapters = { @@ -126,28 +162,35 @@ class MetaConversionsService extends BaseService { } /** - * The dedup identity for a lead event, also sent to Meta as `event_id`. + * The dedup identity for a Meta CAPI event, also sent to Meta as + * `event_id`. Channels whose messaging identity is keyed to an ad click + * (see `channel-policy.ts`) dedup per contact per UTC day; every other + * combination gets a unique id per fire — a distinct conversion each time + * (BullMQ retries of the same stored event still reuse its key, so Meta + * collapses retries). * - * WhatsApp is capped by Meta at one CAPI event per click-to-WhatsApp ad, so - * it dedups per contact per UTC day. Messenger/Instagram have no such cap — - * every fire is a distinct conversion, so a unique id is used (BullMQ retries - * of the same stored event still reuse its key, so Meta collapses retries). + * `actionSource` is optional only for stored steps that predate the field; + * they read as the default, exactly as `enqueueEvent` treats them. */ - buildLeadSourceKey(input: { - scope: "flow" | "trigger" + buildSourceKey(input: { + scope: "flow" | "trigger" | "test" scopeId: string contactInboxId: string channel: MetaConversionsChannel + actionSource?: MetaCapiActionSource }): string { - const dedupSegment = - input.channel === "whatsapp" ? formatUtcDay(new Date()) : createId() + const dedupsPerDay = capiEventDedupsPerUtcDay( + input.channel, + input.actionSource ?? defaultMetaCapiActionSource, + ) + const dedupSegment = dedupsPerDay ? formatUtcDay(new Date()) : createId() return `${input.scope}:${input.scopeId}:${input.contactInboxId}:${dedupSegment}` } - async enqueueLeadEvent( - input: EnqueueLeadEventInput, + async enqueueEvent( + input: EnqueueEventInput, ): Promise { - const parsed = enqueueLeadEventInput.parse(input) + const parsed = enqueueEventInput.parse(input) const occurredAt = parsed.occurredAt ?? new Date() const integration = await resolveIntegrationForChannel(parsed.channel, { inboxId: parsed.inboxId, @@ -160,7 +203,10 @@ class MetaConversionsService extends BaseService { channel: parsed.channel, integrationId: integration.id, contactInboxId: parsed.contactInboxId, - eventName: metaCapiEventName, + eventName: parsed.eventName, + actionSource: parsed.actionSource, + contentType: parsed.contentType ?? null, + contentIds: parsed.contentIds ?? null, currency: parsed.currency ?? null, contentCategory: parsed.contentCategory ?? null, contentName: parsed.contentName ?? null, @@ -267,6 +313,34 @@ class MetaConversionsService extends BaseService { }) } + /** + * Asks Meta to provision (or hand back the already-linked) dataset for the + * resource, via the adapter-selected create token(s). The `dataset` edge is + * idempotent — it returns the dataset currently linked to the page/IG + * user/WABA, creating and linking a new one only when nothing is linked. + * Shared by `ensureDatasetId` (lazy, stored-id-first) and + * `provisionDatasetNow` (always asks Meta), so the Meta-side mechanics never + * drift between the two callers. + */ + private async provisionDatasetViaMeta< + TChannel extends MetaConversionsChannel, + >( + adapter: CapiSendAdapter, + integration: MetaConversionsIntegrationByChannel[TChannel], + provisionDataset: EnsureDatasetIdInput["provisionDataset"], + ): Promise { + // The adapter picks the create token(s); the retry stays channel-agnostic — + // it fires only when the adapter supplied a distinct `fallbackAccessToken` + // (currently WhatsApp's connect-token fallback for its System User token). + const provisionInput = await adapter.buildDatasetProvisionInput(integration) + return createDatasetWithFallback({ + primaryToken: provisionInput.accessToken, + fallbackToken: provisionInput.fallbackAccessToken ?? null, + create: (accessToken) => + provisionDataset({ ...provisionInput, accessToken }), + }) + } + async ensureDatasetId( input: EnsureDatasetIdInput, ): Promise { @@ -281,18 +355,11 @@ class MetaConversionsService extends BaseService { id: input.integration.id, workspaceId: input.integration.workspaceId, } - // The adapter picks the create token(s); the retry stays channel-agnostic — - // it fires only when the adapter supplied a distinct `fallbackAccessToken` - // (currently WhatsApp's connect-token fallback for its System User token). - const provisionInput = await adapter.buildDatasetProvisionInput( + const datasetId = await this.provisionDatasetViaMeta( + adapter, input.integration, + input.provisionDataset, ) - const datasetId = await createDatasetWithFallback({ - primaryToken: provisionInput.accessToken, - fallbackToken: provisionInput.fallbackAccessToken ?? null, - create: (accessToken) => - input.provisionDataset({ ...provisionInput, accessToken }), - }) const updated = await adapter.updateDatasetIdIfNull({ ...ref, datasetId, @@ -329,10 +396,109 @@ class MetaConversionsService extends BaseService { }) } - provisionDatasetNow( + /** + * User-initiated "Create Dataset": always re-asks Meta, unlike the lazy + * `ensureDatasetId` send-path helper. A dataset unlinked in Meta Events + * Manager leaves a stale id in the DB that `ensureDatasetId`'s + * stored-id-first check would keep returning forever — the send path can + * tolerate that (it only needs *a* dataset for the next event), but a user + * clicking "Create Dataset" needs the DB to reflect what Meta actually has + * linked right now, so this path never trusts the stored id and only writes + * when Meta's answer actually changed it. + */ + async provisionDatasetNow( input: ProvisionDatasetNowInput, ): Promise { - return this.ensureDatasetId(input) + const adapter = sendAdapterFor(input.channel) + adapter.assertSupported(input.integration) + + const datasetId = await this.provisionDatasetViaMeta( + adapter, + input.integration, + input.provisionDataset, + ) + + if (datasetId === input.integration.datasetId) { + return datasetId + } + + await adapter.updateDatasetId({ + id: input.integration.id, + workspaceId: input.integration.workspaceId, + datasetId, + }) + + return datasetId + } + + /** + * Set or clear the Events Manager `test_event_code`. While set, the worker + * sends it with every CAPI event of this integration, so Meta shows the + * full payload under Test Events instead of counting the event in + * production reporting. + */ + async saveCapiTestEventCode( + input: SaveCapiTestEventCodeInput, + ): Promise { + const parsed = saveCapiTestEventCodeInput.parse({ + testEventCode: input.testEventCode, + }) + const adapter = sendAdapterFor(input.channel) + adapter.assertSupported(input.integration) + + return await adapter.updateCapiTestEventCode({ + id: input.integration.id, + workspaceId: input.integration.workspaceId, + capiTestEventCode: parsed.testEventCode, + }) + } + + /** + * "Send test event": queues one sample Purchase through the real send + * pipeline, attributed to the inbox's most recent contact (Meta needs a + * real messaging identity even for test events). Refuses to run without a + * saved test_event_code so a test can never become a production event; + * the worker re-checks the code at send time for the same reason. + */ + async enqueueTestEvent( + input: EnqueueTestEventInput, + ): Promise { + if (!input.integration.capiTestEventCode) { + throw new CapiTestEventError("testEventCodeRequired") + } + // Same gate the worker applies to real sends: pick a contact the channel + // can actually send for instead of queuing an event Meta would reject. + // Derived from the sample's action source, so this lookup and the + // `buildSourceKey` call below always agree on the identity rules. + const contactInbox = await contactInboxRepository.findMostRecentByInbox({ + inboxId: input.integration.inboxId, + workspaceId: input.integration.workspaceId, + requireCtwaClid: capiEventRequiresCtwaClid( + input.channel, + capiTestEventSample.actionSource, + ), + }) + if (!contactInbox) { + throw new CapiTestEventError("noContactForTest") + } + + return this.enqueueEvent({ + workspaceId: input.integration.workspaceId, + channel: input.channel, + contactInboxId: contactInbox.id, + inboxId: input.integration.inboxId, + source: "manualTest", + // A fresh scopeId per click so a WhatsApp per-day dedup never swallows + // a second test on the same day. + sourceKey: this.buildSourceKey({ + scope: "test", + scopeId: createId(), + contactInboxId: contactInbox.id, + channel: input.channel, + actionSource: capiTestEventSample.actionSource, + }), + ...capiTestEventSample, + }) } async saveCapiAccessToken( diff --git a/packages/database/__tests__/automation-throttle-repository.test.ts b/packages/database/__tests__/automation-throttle-repository.test.ts index 037512fae6..158e1c1ce9 100644 --- a/packages/database/__tests__/automation-throttle-repository.test.ts +++ b/packages/database/__tests__/automation-throttle-repository.test.ts @@ -4,7 +4,7 @@ import { beforeEach, describe, expect, test, vi } from "vitest" // automation-throttle repository — atomic claim/release/purge against the // AutomationThrottle table. Mocks `db` at the module boundary (query builder // chain) and asserts the CAS/`onConflictDoUpdate` shape without touching a -// real database. See docs/plans/default-reply-throttle-hybrid.md §4/§5. +// real database. // --------------------------------------------------------------------------- const mocks = vi.hoisted(() => ({ diff --git a/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/migration.sql b/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/migration.sql new file mode 100644 index 0000000000..430ee2cc3f --- /dev/null +++ b/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/migration.sql @@ -0,0 +1,5 @@ +ALTER TABLE "MetaCapiEvent" ADD COLUMN "actionSource" text DEFAULT 'business_messaging' NOT NULL;--> statement-breakpoint +ALTER TABLE "MetaCapiEvent" ADD COLUMN "contentType" text;--> statement-breakpoint +ALTER TABLE "MetaCapiEvent" ADD COLUMN "contentIds" jsonb;--> statement-breakpoint +ALTER TABLE "MetaCapiEvent" ADD CONSTRAINT "MetaCapiEvent_actionSource_check" CHECK ("actionSource" IN ('business_messaging', 'email', 'phone_call', 'chat', 'physical_store', 'system_generated', 'other'));--> statement-breakpoint +ALTER TABLE "MetaCapiEvent" ADD CONSTRAINT "MetaCapiEvent_contentType_check" CHECK ("contentType" IN ('product', 'product_group')); \ No newline at end of file diff --git a/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/snapshot.json b/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/snapshot.json new file mode 100644 index 0000000000..c283b36620 --- /dev/null +++ b/packages/database/drizzle/20260903042613_add_meta_capi_event_action_source_content/snapshot.json @@ -0,0 +1,40524 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "da447af0-0dfe-46fe-9d54-ba3095bd9ee1", + "prevIds": ["f06851c2-4b11-4e07-8235-1cfb395ae89c"], + "ddl": [ + { + "values": [ + "pending", + "sent", + "failed", + "skipped_no_scope", + "skipped_region" + ], + "name": "adsConversionCapiStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["automatic", "rule", "trigger"], + "name": "adsConversionEventSource", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "facebook", "messenger", "instagram"], + "name": "adsConversionChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["lead", "purchase"], + "name": "adsConversionEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "success", "error", "processing"], + "name": "aiConversationEmbeddingStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "success", "error"], + "name": "aiConversationSourceStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["document", "image", "url", "web_search"], + "name": "aiConversationSourceType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "success", "error", "processing"], + "name": "aiEmbeddingStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["automated_response", "ai_agent", "flow", "none"], + "name": "analyticsBotResponseType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["success", "fallback"], + "name": "analyticsBotResult", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["flow", "agent", "fallback"], + "name": "analyticsBotRouteType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "message:sent", + "message:delivered", + "message:seen", + "message:failed", + "flow:clicked" + ], + "name": "analyticsBroadcastEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contact_created", "contact_deleted", "contact_blocked"], + "name": "analyticsContactEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["bot", "human"], + "name": "analyticsContactSenderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "conversation_created", + "conversation_assigned", + "conversation_unassigned", + "conversation_transferred_to_human", + "conversation_transferred_to_bot", + "conversation_followed", + "conversation_unfollowed", + "conversation_archived", + "conversation_unarchived" + ], + "name": "analyticsConversationEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["message_human_sent", "message_bot_sent"], + "name": "analyticsMessageEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["processing", "ingested", "failed"], + "name": "analyticsStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "synced", "failed"], + "name": "appointmentExternalSyncStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inPerson", "phoneCall", "onlineMeeting"], + "name": "appointmentLocationTypeSnapshot", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["scheduled", "cancelled"], + "name": "appointmentStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inPerson", "phoneCall", "onlineMeeting"], + "name": "appointmentLocationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["rollingDays", "dateRange", "specificDay", "anyFutureDate"], + "name": "appointmentScheduleWindowType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["minutes", "hours", "days"], + "name": "appointmentReminderTimingUnit", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "sent", "cancelled", "failed"], + "name": "appointmentReminderDispatchStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["image", "video", "audio", "gif", "file"], + "name": "fileType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inbound", "outbound"], + "name": "automatedResponseType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["defaultReply"], + "name": "automationThrottleType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["now", "future"], + "name": "broadcastScheduleType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "scheduled", + "sent", + "sending", + "cancelled", + "draft", + "failed" + ], + "name": "broadcastStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "messenger", "instagram"], + "name": "coexistChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contacts", "messages"], + "name": "coexistMessengerSyncPhase", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["init", "running", "succeeded", "failed", "partial"], + "name": "coexistRunStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["male", "female", "unknown"], + "name": "gender", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "text", + "location", + "refLink", + "image", + "video", + "audio", + "gif", + "file" + ], + "name": "lastUserInputType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "scheduled", "completed", "failed", "canceled"], + "name": "ContactOnSmartDelayStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["waitNode", "followUp"], + "name": "ContactOnSmartDelayType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["active", "archived"], + "name": "couponTopicStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "shortText", + "email", + "phoneNumber", + "number", + "date", + "datetime", + "boolean", + "longText" + ], + "name": "customFieldType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["messenger", "instagram", "instagramFacebook"], + "name": "fbCommentAutomationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["import", "generic", "export"], + "name": "fileContextType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "uploaded", "failed"], + "name": "fileStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "tag", + "flow", + "customField", + "automatedResponse", + "trigger", + "webhook", + "sequence", + "emailTopic", + "fbComment", + "igComment", + "igStory", + "outboundAutomatedResponse" + ], + "name": "folderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["instagram", "instagramFacebook"], + "name": "igStoryAutomationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["csv", "xlsx", "xls", "json"], + "name": "importFormat", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "completed", "failed"], + "name": "importStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contacts", "coupons", "products", "flow"], + "name": "importType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["oauth", "fbe"], + "name": "metaCatalogAuthMode", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["active", "invalid"], + "name": "metaCatalogConnectionStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["idle", "queued", "running", "succeeded", "partial", "failed"], + "name": "metaCatalogImportStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending_verification", "registered", "failed"], + "name": "whatsappRegistrationStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["text", "location", "refLink"], + "name": "contentType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["message", "comment"], + "name": "messageKind", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["incoming", "outgoing", "activity"], + "name": "messageType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["bot", "contact", "system", "user", "api"], + "name": "senderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "completed", "failed"], + "name": "MessageCleanupStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "messenger", "instagram"], + "name": "messagingAdChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "pending", + "campaignCreated", + "adSetCreated", + "creativeCreated", + "adCreated", + "failed" + ], + "name": "messagingAdCreateState", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "draft", + "publishing", + "published", + "pausing", + "paused", + "deleting", + "deleted", + "publishFailed" + ], + "name": "messagingAdPublishState", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["push", "import"], + "name": "metaCatalogItemDirection", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["all", "category", "selected"], + "name": "metaCatalogSyncScope", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["queued", "running", "succeeded", "partial", "failed"], + "name": "metaCatalogSyncStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["luckyWheel", "jackpot", "gashapon", "drawLots", "scratchOff"], + "name": "minigameType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["dont_track", "track"], + "name": "inventoryPolicy", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "text", + "number", + "email", + "phone", + "multipleChoice", + "date", + "datetime", + "image", + "file", + "location", + "websiteLink" + ], + "name": "questionnaireQuestionType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inProgress", "completed", "cancelled", "failed", "timeout"], + "name": "questionnaireSubmissionStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["refLink", "qrCode"], + "name": "ReflinkType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["me"], + "name": "SystemFieldType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "installing", "completed", "partial", "failed"], + "name": "templateInstallationStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "flows", + "products", + "aiFunctions", + "aiAgents", + "calendars", + "webchats", + "keywords", + "entryPointLinks", + "triggers", + "fbCommentAutomations", + "settings", + "customFields", + "tags", + "productCategories" + ], + "name": "templateResourceCategory", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["ios", "android"], + "name": "devicePlatform", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["allTime", "oncePerHour", "oncePerDay"], + "name": "defaultReplyFrequency", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["owner", "agent"], + "name": "workspaceMemberRole", + "entityType": "enums", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessageShard", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ShardTimeRange", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AdsConversionEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AdsConversionRule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIAgent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIAssistant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIConversationEmbedding", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIConversationSource", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIEmbedding", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIFile", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIFunction", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIMCPServer", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AITrigger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AITriggerToIntegrationOpenai", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsBotMessageEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsBroadcastEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsContactEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsConversationEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsFlowNodeEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsMessageEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsSequenceEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsEmailTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsManifestStatus", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Appointment", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendarAvailability", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendarReminder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentReminderDispatch", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Attachment", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Account", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Invitation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Jwk", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Session", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "User", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Verification", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AutomatedResponse", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AutomationThrottle", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "BotField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Broadcast", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CoexistSyncRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Contact", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactActiveHourly", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactActiveMonthly", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactCustomField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactInbox", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactNote", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnBroadcast", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnSequence", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnSmartDelay", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactToTag", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactToTagChannel", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Conversation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ConversationParticipant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Coupon", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CouponTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CustomField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "DynamicImage", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "EmailTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AuditLog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CustomDomain", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Tenant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TenantHelpItem", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserQuota", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceUsage", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ErrorLog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ExternalWebhook", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FacebookLeadAdsAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FacebookLeadAdsLead", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FBCommentAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FBCommentAutomationReply", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "File", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Flow", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowAnalyticsSession", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowNodeStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowVersion", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Folder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IgStoryAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Import", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Inbox", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxContactStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxTeam", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxTeamMember", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationActiveCampaign", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationApi", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Integration", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationClaude", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationDeepseek", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationDrip", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationFacebookAds", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGemini", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGetResponse", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGoogleCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGoogleSheet", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationInstagram", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationKlaviyo", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMailchimp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMailerLite", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMessenger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMetaCatalog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMoosend", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenai", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenaiCompatible", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenrouter", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOutlookCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationSendGrid", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationSmtp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationTelegram", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationTiktok", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationWebchat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationWhatsapp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationZalo", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MagicLink", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MagicLinkStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MediaLibraryFile", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MediaLibraryFolder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessageCleanup", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessagingAdOperation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessagingAdsConnection", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessengerMessageTemplate", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCapiEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCatalogItem", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCatalogSyncRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Minigame", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MinigameContact", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MinigamePlay", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "PlatformCredential", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Product", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductAddon", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductCategory", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductVariant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductVariantOption", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireAnswer", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Questionnaire", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireQuestion", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireSubmission", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "RefLinkStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Reflink", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SavedReply", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Sequence", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SequenceDispatch", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SequenceStep", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Spreadsheet", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SystemField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Tag", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TagChannel", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Template", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TemplateInstallation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TemplateInstalledResource", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Trigger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Condition", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerContactHistory", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerExecution", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserDeviceToken", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserPersistentMenu", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Webhook", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WebhookExecution", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappCoexistStaging", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappFlow", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappMessageTemplate", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappSignupSession", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Workspace", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceMac", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceMember", + "entityType": "tables", + "schema": "public" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "5432", + "generated": null, + "identity": null, + "name": "port", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "database", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credentialRef", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'disable'", + "generated": null, + "identity": null, + "name": "sslMode", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isMain", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shardKey", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "readHost", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "readPort", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shardId", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'whatsapp'", + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionEventSource", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ctwaClid", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orderId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contents", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceEventId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionCapiStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "capiStatus", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiSentAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "adsConversionChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationFacebookAdsId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adAccountId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "adsConversionEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trigger", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "markAs", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isDefault", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isRichResponse", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "webSearchAuthorizedDomains", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "models", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "aiTriggerIds", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "attachmentIds", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "chunkIndex", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "vector(1536)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "embedding", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "aiConversationEmbeddingStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attachmentId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "aiConversationSourceType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceType", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "aiConversationSourceStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceKey", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentHash", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "summary", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "vector(1536)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "embedding", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "aiEmbeddingStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiFileId", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dataCollect", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "outputMessage", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerFlowId", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "availableTools", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "selectedTools", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "questions", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finalMessage", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiTriggerId", + "entityType": "columns", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationOpenaiId", + "entityType": "columns", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasResponse", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotResponseType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responseType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotRouteType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routeType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotResult", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "result", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiProvider", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "analyticsBroadcastEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "batchId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "analyticsContactEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "analyticsContactSenderType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "analyticsConversationEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fromAssignee", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "toAssignee", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "analyticsId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "buttonId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "analyticsMessageEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "analyticsContactSenderType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "topicId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstSeenAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSeenAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "seenCount", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstClickedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastClickedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "clickCount", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "objectKey", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "analyticsStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ingestedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inviteeTimezone", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'scheduled'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentLocationTypeSnapshot", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationType", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationDetail", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalEventId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentExternalSyncStatus", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalSyncStatus", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "30", + "generated": null, + "identity": null, + "name": "durationMinutes", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bufferAfterMinutes", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "appointmentLocationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationType", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationDetail", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "appointmentScheduleWindowType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'rollingDays'", + "generated": null, + "identity": null, + "name": "scheduleWindowType", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "scheduleWindowConfig", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxAppointmentsPerUser", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "dailyLimitEnabled", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxPerDay", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowGroupMeeting", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxPerSlot", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "confirmationMessage", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "confirmationFlowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancellationFlowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalConnectionId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicLinkSlug", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "weekday", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startMinute", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endMinute", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timingValue", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "appointmentReminderTimingUnit", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timingUnit", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appointmentId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reminderConfigId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "appointmentReminderDispatchStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "jobId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sentAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedReason", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageCreatedAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "fileType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileType", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "width", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "height", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "thumbnailPath", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "originPath", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accountId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "providerId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accessToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accessTokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refreshToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refreshTokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "invitedBy", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicKey", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "privateKey", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ipAddress", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userAgent", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailVerified", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isAnonymous", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "mustChangePassword", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "keywords", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "automatedResponseType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'inbound'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "automationThrottleType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "throttleType", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subjectId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "lastTriggeredAt", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "customFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateData", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "broadcastStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "broadcastScheduleType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schedulesType", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schedulesAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactFilter", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subaction", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactCount", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "handoffCompletedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "resumeCount", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistRunStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'init'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerSource", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finishedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastHeartbeatAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalScan", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentScan", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentPageNumber", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedContactCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedMessageCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "skippedCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentError", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastPhase", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastChunkOrder", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "syncProgress", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistMessengerSyncPhase", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'contacts'", + "generated": null, + "identity": null, + "name": "messengerSyncPhase", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avatar", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumber", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailVerified", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "emailOptIn", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "CASE\n WHEN \"firstName\" IS NULL AND \"lastName\" IS NULL THEN NULL\n WHEN \"firstName\" IS NULL THEN \"lastName\"\n WHEN \"lastName\" IS NULL THEN \"firstName\"\n ELSE \"firstName\" || ' ' || \"lastName\"\n END", + "type": "stored" + }, + "identity": null, + "name": "fullName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "gender", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gender", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ref", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "city", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locale", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subscribedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastSubscribedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blockedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hourBucket", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceMacId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "originalContactId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "personaId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstInteractionAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastIncomingMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastOutboundMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referral", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastCommentMessageId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastCommentMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "consecutiveFailedReply", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastInputFailure", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastErrorLog", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastBtnTitle", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUserInput", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "lastUserInputType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUserInputType", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webchatParentUrl", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUserId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUsername", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdById", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "sent", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "clickedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "case when \"seenAt\" is null then false when \"deliveredAt\" is null then false else \"seenAt\" >= \"deliveredAt\" end", + "type": "stored" + }, + "identity": null, + "name": "isRead", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "enrolledAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nextRunAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastStepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nextStepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockOwner", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowVersionId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appointmentId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "ContactOnSmartDelayType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "ContactOnSmartDelayStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagChannelId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "botEnabled", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botResumeAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archivedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "additionalAttributes", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agentLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiContextLastMessageId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastActivityAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "followed", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "assignedUserId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "assignedInboxTeamId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastStep", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminRepliedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactRepliedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "topicId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuedContactId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "usedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "couponTopicStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasEverHadCoupon", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdById", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "customFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "showInInbox", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "backgroundUrl", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sendsTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "deliveredsTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "seensTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "clicksTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "detail", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ipAddress", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userAgent", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "domain", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verifiedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfHostnameId", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfOwnershipValue", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfAcmeValue", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "disabledReason", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brandName", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logoLightPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logoDarkPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "faviconPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customCss", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customJs", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "theme", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storageUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "policyUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "termsOfServiceUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "signupEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "forgotPasswordEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "magicLinkEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accountCredentialsEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hiddenChannels", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactsLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "contactsUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspacesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "workspacesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelsLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "channelsUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "teamMembersLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "teamMembersUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "macLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botMessagesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "monthlyBotMessagesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "monthlyBotMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "monthlyBotMessagesPeriodStart", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesTopUpGranted", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "whiteLabel", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "ssoSaml", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "saasMode", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "planName", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "planStatus", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "selectedTrialPlanId", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodEnd", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelsTornDownAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "syncedAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "contactsUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "channelsUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "teamMembersUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "syncedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "detail", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "httpCode", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'make'", + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageName", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formName", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "fieldMapping", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "leadsHandledCount", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automationId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "leadgenId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "fbCommentAutomationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'messenger'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "repliesCount", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "post", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"text\",\"value\":\"\"}'", + "generated": null, + "identity": null, + "name": "privateReply", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"none\",\"value\":null}'", + "generated": null, + "identity": null, + "name": "publicReply", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "includeKeywords", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "excludeKeywords", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"replyToNewContactsOnly\":false,\"replyOncePerUserPerPost\":false,\"likeUserComment\":false,\"replyToUsersWhoCommentedOnOtherPosts\":true,\"ignoreCommentReplies\":true,\"trackUserTags\":false}'", + "generated": null, + "identity": null, + "name": "options", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"all\":false,\"hasPhoneNumber\":false,\"hasImage\":false,\"hasVideo\":false,\"hasLink\":false,\"hasKeywords\":false,\"keywords\":[],\"showCommentsAfter\":\"none\"}'", + "generated": null, + "identity": null, + "name": "hideComments", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"immediately\",\"value\":0}'", + "generated": null, + "identity": null, + "name": "replyAfter", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automationId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "postId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "fileContextType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contextType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileName", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileSize", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "fileStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "meta", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "uploadedAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enableInInbox", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentVersionId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draftVersionId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "analyticsId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "buttonId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refType", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowVersionId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "nodes", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "edges", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isDraft", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isLatest", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startNodeId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "folderType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderType", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isTrash", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "paths", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "igStoryAutomationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "repliesCount", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "story", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"none\",\"value\":null}'", + "generated": null, + "identity": null, + "name": "reply", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "includeKeywords", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importFormat", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "format", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "meta", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "processedCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "successCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "errorSample", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'connected'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalContacts", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxTeamId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenHash", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenPrefix", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callbackUrl", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationType", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'primary'", + "generated": null, + "identity": null, + "name": "providerCalendarId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userInfo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "igId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'instagram'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userInfo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "personas", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "personaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "syncTagEnabledAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogName", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "encryptedAuth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogAuthMode", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'oauth'", + "generated": null, + "identity": null, + "name": "authMode", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogConnectionStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogImportStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'idle'", + "generated": null, + "identity": null, + "name": "importStatus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importTotalCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importFailedCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "importError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastImportedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'VND'", + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storeUrl", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReplyVoice", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "voice", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiAssistantId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiAgentId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "baseURL", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultModel", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "preset", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'primary'", + "generated": null, + "identity": null, + "name": "providerCalendarId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fromAddress", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enable", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "authorizedDomains", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brandColor", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hideHeader", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "showLogo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hideMessageInput", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customCss", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumberId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "displayPhoneNumber", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isCoexist", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "platformType", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "historyDeclined", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "whatsappRegistrationStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending_verification'", + "generated": null, + "identity": null, + "name": "registrationStatus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registrationError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verificationCodeRequestedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "oaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fallbackFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "syncTagEnabledAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linkId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isFavourite", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastAccessedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentAttributes", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "messageType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "contentType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "senderType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "messageKind", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'message'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attributes", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendError", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationIds", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sinceTime", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "MessageCleanupStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adAccountId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdCreateState", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "createState", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdPublishState", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'draft'", + "generated": null, + "identity": null, + "name": "publishState", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaCampaignId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdSetId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdCreativeId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cleanupError", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdBy", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "messagingAdChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'POSITIONAL'", + "generated": null, + "identity": null, + "name": "parameterFormat", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "components", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventName", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentCategory", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentName", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'business_messaging'", + "generated": null, + "identity": null, + "name": "actionSource", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentType", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentIds", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceKey", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "capiStatus", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiSentAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiError", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMetaCatalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "metaCatalogItemDirection", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'push'", + "generated": null, + "identity": null, + "name": "direction", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retailerId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedFingerprint", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMetaCatalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogSyncStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'queued'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogItemDirection", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'push'", + "generated": null, + "identity": null, + "name": "direction", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogSyncScope", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'all'", + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "selectedProductIds", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "handles", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "submissionLeaseId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "succeededCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "skippedCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "itemErrors", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "skippedItems", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pollAttempt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finishedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "minigameType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "generalSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appearance", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "playerSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "winningMessageSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nonWinningMessageSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minigameId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "played", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "remaining", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referrerContactId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minigameId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isWinning", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeName", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicConfig", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "livemode", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "usePlatformCredential", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isVerified", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verifiedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUsedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shortDescription", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longDescription", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "price", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "taxes", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'USD'", + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productUrl", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sku", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "inventoryPolicy", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'dont_track'", + "generated": null, + "identity": null, + "name": "inventoryPolicy", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "inventoryQuantity", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowOutOfStockPurchase", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "images", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "tags", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "vendor", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "rank", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subcategoryId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isSearchable", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowSpecialRequest", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isAddonOnly", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "maxSelections", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "addonProductIds", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "rank", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "combination", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "price", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isEnabled", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "values", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "submissionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionIdSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionTitleSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionTypeSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "labelSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pointsEarned", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "attemptCount", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "answeredAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "enableScore", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "enableRetryMessages", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enableCustomFieldMapping", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerFlowId", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionnaireId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "questionnaireQuestionType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "orderNo", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "point", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retryMessage", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "systemFieldKey", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionnaireId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "questionnaireSubmissionStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'inProgress'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "totalPoints", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentQuestionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentQuestionSentAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastAnsweredMessageId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linkId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "ReflinkType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'refLink'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "qrStyles", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shortcut", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "subscribers", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "runAtMs", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bucket", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idempotencyKey", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockOwner", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "clickedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enrollmentId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "case when \"seenAt\" is null then false when \"deliveredAt\" is null then false else \"seenAt\" >= \"deliveredAt\" end", + "type": "stored" + }, + "identity": null, + "name": "isRead", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "order", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delayDays", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "delayMinutes", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delayUnit", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "specificDateTime", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "anytime", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendTimeStart", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendTimeEnd", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\"]'", + "generated": null, + "identity": null, + "name": "sendDays", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "spreadsheetId", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "SystemFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelType", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalLabelId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "imageUrl", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publisherName", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "youtubeVideoId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "testLink", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "selection", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryCounts", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formatVersion", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shareToken", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "shareEnabled", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shareExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultPermissions", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "createInstallFolder", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "defaultAutoUpdate", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "installCount", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdBy", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateName", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceWorkspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formatVersion", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "templateInstallationStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "warnings", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "warningCount", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "resourceCount", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installFolderId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoUpdate", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUpdatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installedBy", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installationId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "templateResourceCategory", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resourceKind", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resourceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceResourceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "wasExisting", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "actions", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webhookId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "varchar(255)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operator", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstEnteredAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "executedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalContacts", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "successCount", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failureCount", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalExecutions", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "devicePlatform", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "platform", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "lastSeenAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "menus", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "executedAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webhookId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumberId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payloadHash", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "categories", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "validationErrors", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "completedCount", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "screens", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "components", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "encryptedAccessToken", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiVersion", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "candidatePhoneNumberIds", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "consumedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultReply", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "defaultReplyFrequency", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'allTime'", + "generated": null, + "identity": null, + "name": "defaultReplyFrequency", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "targetCountry", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'en'", + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'UTC'", + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'#016DFF'", + "generated": null, + "identity": null, + "name": "brandColor", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "developmentMode", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "smartResponseDelaySeconds", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logo", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scheduledDeletionAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "capiLimitedDataUse", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodEnd", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macCount", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "workspaceMemberRole", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notificationChannels", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notificationTypes", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "isActive", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageShard_isActive_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageShard" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shardKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageShard_shardKey_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageShard" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "startTime", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "endTime", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ShardTimeRange_time_lookup_idx", + "entityType": "indexes", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shardId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ShardTimeRange_shardId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspace_integration_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'whatsapp'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_whatsapp_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'messenger'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_messenger_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'instagram'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_instagram_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_adId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "enabled", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionRule_workspaceId_channel_enabled_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_sourceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "chunkIndex", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_sourceId_chunkIndex_key", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "embedding", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "vector_cosine_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "hnsw", + "concurrently": false, + "name": "AIConversationEmbedding_embedding_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_lookup_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_workspaceId_sourceType_sourceKey_key", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "messageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_messageId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIEmbedding_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "aiProvider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_aiProvider_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hasResponse", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "result", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_hasResponse_result_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "broadcastId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBroadcastEvent_workspaceId_broadcastId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adminId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_adminId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsConversationEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "toAssignee", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsConversationEvent_workspaceId_toAssignee_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsFlowNodeEvent_workspaceId_flowId_analyticsId_nodeId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "buttonId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsFlowNodeEvent_workspaceId_flowId_analyticsId_nodeId_buttonId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adminId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_adminId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "senderType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_senderType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsSequenceEvent_workspaceId_sequenceId_stepId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "token", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_token_key", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_workspaceId_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "objectKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsManifestStatus_objectKey_key", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "startAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_workspaceId_startAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "startAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_calendarId_status_startAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_contactId_calendarId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "publicLinkSlug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_publicLinkSlug_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendarAvailability_calendarId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "timingValue", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "timingUnit", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendarReminder_dedupe_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "jobId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_jobId_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sendAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_status_sendAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "appointmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_appointmentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "messageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "messageCreatedAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_message_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_workspaceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "providerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "accountId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Account_providerId_accountId_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Invitation_code_key", + "entityType": "indexes", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "token", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Session_token_key", + "entityType": "indexes", + "schema": "public", + "table": "Session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "User_email_tenant_key", + "entityType": "indexes", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "User_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AutomatedResponse_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lastTriggeredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AutomationThrottle_lastTriggeredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "BotField_workspaceId_type_name_key", + "entityType": "indexes", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_channel_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "schedulesAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_schedulesAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"deletedAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_workspace_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastHeartbeatAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "status IN ('init', 'running')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "\"startedAt\" DESC", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "status IN ('succeeded', 'partial')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_resume_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "status = 'init'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_init_uq", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "broadcastSubscribedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_broadcast_subscribed_at", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_workspace_created_at", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "firstName", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_firstName_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lastName", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_lastName_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_email_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumber", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_phoneNumber_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactCustomField_contactId_customFieldId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactCustomField_customFieldId_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_inboxId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceUserId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceUserId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_inboxId_sourceUserId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastIncomingMessageAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_contactId_lastIncomingMessageAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastOutboundMessageAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_contactId_lastOutboundMessageAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "(\"referral\"->>'ctwaClid')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"referral\"->>'ctwaClid' IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_referral_ctwaClid_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "(\"referral\"->>'adId')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"referral\"->>'adId' IS NOT NULL AND \"referral\"->>'source' = 'ADS'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_referral_adId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactNote_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_on_broadcast_contact_id", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "isRead", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_on_broadcast_is_read", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "broadcastId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"sent\" = false AND \"failedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnBroadcast_unsent_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_sequenceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nextRunAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_status_nextRunAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nextRunAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_workspaceId_status_nextRunAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_contactId_sequenceId_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_workspaceId_flowId_contactInboxId_stepId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "triggerAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_status_triggerAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "appointmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_appointmentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" NOT IN ('completed', 'failed', 'canceled') AND \"type\" = 'followUp'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_followUp_active_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactToTagChannel_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tagId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactToTagChannel_tagId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_contactId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceId\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_contactId_dm_key", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "aiContextLastMessageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_aiContextLastMessageId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastActivityAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_workspaceId_lastActivityAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_conversationId_userId_key", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_code_key", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"issuedContactId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_key", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_issuedContactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "issuedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_issuedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "usedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_usedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_code_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "usedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_usedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_status_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "expiresAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_expiresAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"deletedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_name_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomField_workspaceId_type_name_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "DynamicImage_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "EmailTopic_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "EmailTopic_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AuditLog_workspaceId_createdAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"userId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AuditLog_workspaceId_userId_createdAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_tenantId_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "domain", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_domain_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "ownerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tenant_ownerId_key", + "entityType": "indexes", + "schema": "public", + "table": "Tenant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "position", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TenantHelpItem_tenantId_position_idx", + "entityType": "indexes", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelsTornDownAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserQuota_channelsTornDownAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"channelsTornDownAt\" IS NULL AND \"planStatus\" = 'trial'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserQuota_due_expired_trial_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": true, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_workspaceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "event", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ExternalWebhook_workspaceId_event_idx", + "entityType": "indexes", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "event", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "url", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ExternalWebhook_workspaceId_event_url_key", + "entityType": "indexes", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "pageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "formId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsAutomation_workspaceId_pageId_formId_key", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "automationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "leadgenId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsLead_automationId_leadgenId_key", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "leadgenId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsLead_leadgenId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomation_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "automationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "postId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomationReply_dedup_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomationReply_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "path", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_path_key", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contextType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_workspaceId_contextType_idx", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "subType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_workspaceId_subType_idx", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"deletedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowAnalyticsSession_workspaceId_flowId_key", + "entityType": "indexes", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowAnalyticsSession_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "buttonId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowNodeStat_filter_1_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"eventType\" = 'seen' AND \"seenAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowNodeStat_filter_2_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowRun_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Folder_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Folder_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IgStoryAutomation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IgStoryAutomation_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_workspaceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_workspaceId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_inboxId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "fileId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_fileId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"type\" = 'products' AND \"status\" IN ('pending', 'processing')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_products_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Inbox_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Inbox_workspaceId_channel_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationActiveCampaign_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationActiveCampaign_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tokenHash", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_tokenHash_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Integration_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Integration_workspaceId_integrationType_key", + "entityType": "indexes", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationClaude_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationClaude_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDeepseek_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDeepseek_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDrip_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDrip_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationFacebookAds_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationFacebookAds_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGemini_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGemini_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGetResponse_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGetResponse_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGoogleCalendar_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGoogleSheet_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "igId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_igId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationKlaviyo_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationKlaviyo_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailchimp_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailchimp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailerLite_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailerLite_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "pageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_pageId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMoosend_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMoosend_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenAI_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "preset", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"preset\" <> 'custom'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_workspaceId_preset_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenrouter_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenrouter_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOutlookCalendar_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSendGrid_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSendGrid_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSmtp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSmtp_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "botId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_botId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "openId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_openId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_inboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_phoneNumberId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "fallbackFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_fallbackFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLink_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLink_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "linkId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLinkStat_workspaceId_linkId_occurredAt_contactInboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFile_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFile_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFolder_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_conversation_history_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_workspace_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_contactInboxId_sourceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_conversationId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"parentId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_inboxId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_status_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationWhatsappId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationMessengerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationInstagramId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationWhatsappId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationMessengerId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationInstagramId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessengerMessageTemplate_integrationMessengerId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_workspaceId_channel_sourceKey_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_channel_integrationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMetaCatalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "catalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "retailerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_integration_retailer_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMetaCatalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "catalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_integration_product_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" IN ('queued', 'running')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogSyncRun_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Minigame_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Minigame_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_minigameId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_minigameId_contactId_key", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigamePlay_minigameId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigamePlay_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "livemode", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"userId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_user_type_livemode_key", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "livemode", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"userId\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_platform_type_livemode_key", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "categoryId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_categoryId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "subcategoryId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_subcategoryId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductAddon_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductAddon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductCategory_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductCategory_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductVariant_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductVariant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductVariantOption_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "submissionId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "questionIdSnapshot", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireAnswer_submissionId_questionIdSnapshot_key", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireAnswer_questionId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Questionnaire_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Questionnaire_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "orderNo", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireQuestion_questionnaireId_orderNo_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireQuestion_customFieldId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_questionnaireId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_questionnaireId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" = 'inProgress'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_workspaceId_contactId_active_key", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "RefLinkStat_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "linkId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "RefLinkStat_workspaceId_linkId_occurredAt_contactInboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Reflink_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Sequence_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Sequence_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "idempotencyKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_idempotencyKey_key", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_pending_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "bucket", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_pending_bucket_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_workspaceId_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "enrollmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_enrollmentId_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_workspace_sequence_step_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "bucket", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_bucket_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "updatedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" in ('completed', 'failed', 'canceled')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_terminal_updatedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceStep_sequenceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceStep_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "spreadsheetId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_workspaceId_spreadsheetId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "spreadsheetId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_spreadsheetId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tag_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tag_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tagId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_tag_integration_key", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "externalLabelId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_external_key", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_workspace_channel_idx", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_integration_idx", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shareToken", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_shareToken_key", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "templateId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_templateId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_workspaceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "installationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstalledResource_installationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "resourceKind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "resourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstalledResource_workspaceId_resourceKind_resourceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "active", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_source_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_triggerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_webhookId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_sourceId_triggerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_sourceId_webhookId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_triggerId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_triggerId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_triggerId_date_key", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_triggerId_date_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_workspaceId_date_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserDeviceToken_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserPersistentMenu_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "active", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_workspaceId_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_webhookId_contactId_key", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_phoneNumberId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "payloadHash", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_phone_hash_uq", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "processedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"processedAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_processedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappFlow_integrationWhatsappId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappMessageTemplate_integrationWhatsappId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappSignupSession_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expiresAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappSignupSession_expiresAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Workspace_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "scheduledDeletionAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Workspace_scheduledDeletionAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["shardId"], + "schemaTo": "public", + "tableTo": "MessageShard", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ShardTimeRange_shardId_MessageShard_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_IENNsXLBb1k1_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_yeTDEtvJMs4H_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_1X1qUqZpm24x_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AdsConversionEvent_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_k99JXbMObQIn_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationFacebookAdsId"], + "schemaTo": "public", + "tableTo": "IntegrationFacebookAds", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_fBmu8W26Mw5R_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_3zzAptVRRuZD_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_HUibBtSUZbML_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIAgent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIAgent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIAssistant_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIAssistant" + }, + { + "nameExplicit": false, + "columns": ["sourceId"], + "schemaTo": "public", + "tableTo": "AIConversationSource", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_sourceId_AIConversationSource_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationSource_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationSource_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIEmbedding_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": false, + "columns": ["aiFileId"], + "schemaTo": "public", + "tableTo": "AIFile", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIEmbedding_aiFileId_AIFile_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIFile_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFile" + }, + { + "nameExplicit": false, + "columns": ["triggerFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AIFunction_triggerFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFunction" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIFunction_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFunction" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIMCPServer_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIMCPServer" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITrigger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITrigger" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AITrigger_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITrigger" + }, + { + "nameExplicit": false, + "columns": ["aiTriggerId"], + "schemaTo": "public", + "tableTo": "AITrigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITriggerToIntegrationOpenai_aiTriggerId_AITrigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationOpenaiId"], + "schemaTo": "public", + "tableTo": "IntegrationOpenai", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITriggerToIntegrationOpenai_rSgeY7c25Tng_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsBotMessageEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsBroadcastEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsContactEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsConversationEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsFlowNodeEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsMessageEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsSequenceEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "nameExplicit": false, + "columns": ["topicId"], + "schemaTo": "public", + "tableTo": "EmailTopic", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AnalyticsEmailTopic_topicId_EmailTopic_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AnalyticsEmailTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Appointment_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Appointment_calendarId_AppointmentCalendar_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Appointment_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Appointment_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["confirmationFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_confirmationFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["cancellationFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_cancellationFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["externalConnectionId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_externalConnectionId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarAvailability_QfahoIQAX592_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarReminder_5O4INfYC3dY3_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarReminder_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["appointmentId"], + "schemaTo": "public", + "tableTo": "Appointment", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_appointmentId_Appointment_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["reminderConfigId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendarReminder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_a526jJM55OD7_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentReminderDispatch_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Account_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Account_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Invitation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": false, + "columns": ["invitedBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Invitation_invitedBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Session_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Session" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "User_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomatedResponse_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AutomatedResponse_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AutomatedResponse_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomationThrottle_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomationThrottle_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "BotField_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "BotField_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Broadcast_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Broadcast_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Broadcast_integrationWhatsappId_IntegrationWhatsapp_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Broadcast_integrationMessengerId_IntegrationMessenger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Contact_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactCustomField_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactCustomField_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactInbox_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactInbox_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactNote_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": false, + "columns": ["createdById"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactNote_createdById_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": false, + "columns": ["broadcastId"], + "schemaTo": "public", + "tableTo": "Broadcast", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_broadcastId_Broadcast_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSmartDelay_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["appointmentId"], + "schemaTo": "public", + "tableTo": "Appointment", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "ContactOnSmartDelay_appointmentId_Appointment_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSmartDelay_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTag_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTag" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTag_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTag" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["tagChannelId"], + "schemaTo": "public", + "tableTo": "TagChannel", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_tagChannelId_TagChannel_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["assignedUserId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Conversation_assignedUserId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["assignedInboxTeamId"], + "schemaTo": "public", + "tableTo": "InboxTeam", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Conversation_assignedInboxTeamId_InboxTeam_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Conversation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Conversation_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Coupon_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["topicId"], + "schemaTo": "public", + "tableTo": "CouponTopic", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Coupon_topicId_CouponTopic_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["issuedContactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Coupon_issuedContactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CouponTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": false, + "columns": ["createdById"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "CouponTopic_createdById_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "CustomField_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CustomField_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "DynamicImage_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "DynamicImage_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "EmailTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "EmailTopic_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AuditLog_workspaceId_fkey", + "entityType": "fks", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AuditLog_userId_fkey", + "entityType": "fks", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CustomDomain_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Tenant_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tenant" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TenantHelpItem_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "UserQuota_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "WorkspaceUsage_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ErrorLog_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "ErrorLog_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ExternalWebhook_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FacebookLeadAdsAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FacebookLeadAdsAutomation_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": false, + "columns": ["automationId"], + "schemaTo": "public", + "tableTo": "FacebookLeadAdsAutomation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FacebookLeadAdsLead_n8swD949nr3L_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FacebookLeadAdsLead_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FBCommentAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FBCommentAutomation_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": false, + "columns": ["automationId"], + "schemaTo": "public", + "tableTo": "FBCommentAutomation", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_Q6yXIfuQcsD0_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "File_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "File_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Flow_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Flow" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Flow_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Flow" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowNodeStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["flowVersionId"], + "schemaTo": "public", + "tableTo": "FlowVersion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_flowVersionId_FlowVersion_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowVersion_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowVersion" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowVersion_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowVersion" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Folder_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IgStoryAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IgStoryAutomation_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Import_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Import_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Import_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["fileId"], + "schemaTo": "public", + "tableTo": "File", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Import_fileId_File_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Inbox_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxContactStat_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxContactStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeam_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeam" + }, + { + "nameExplicit": false, + "columns": ["inboxTeamId"], + "schemaTo": "public", + "tableTo": "InboxTeam", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeamMember_inboxTeamId_InboxTeam_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeamMember_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationActiveCampaign_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationActiveCampaign_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationApi_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationApi_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Integration_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationClaude_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationClaude_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDeepseek_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDeepseek_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDrip_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDrip_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationFacebookAds_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationFacebookAds_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGemini_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGemini_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGetResponse_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGetResponse_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleCalendar_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleSheet_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleSheet_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": true, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationInstagram_workspaceId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationInstagram_inboxId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationInstagram_welcomeFlowId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationKlaviyo_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationKlaviyo_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailchimp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailchimp_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailerLite_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailerLite_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMessenger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMessenger_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationMessenger_welcomeFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMetaCatalog_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMetaCatalog_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMoosend_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMoosend_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenai_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenai_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["aiAssistantId"], + "schemaTo": "public", + "tableTo": "AIAssistant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationOpenai_aiAssistantId_AIAssistant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["aiAgentId"], + "schemaTo": "public", + "tableTo": "AIAgent", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationOpenai_aiAgentId_AIAgent_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenaiCompatible_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenaiCompatible_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenrouter_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenrouter_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOutlookCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOutlookCalendar_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSendGrid_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSendGrid_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSmtp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSmtp_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTelegram_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTelegram_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTiktok_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTiktok_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWebchat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWebchat_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationWebchat_welcomeFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWhatsapp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWhatsapp_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationZalo_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationZalo_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["fallbackFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationZalo_fallbackFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLink_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLinkStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": false, + "columns": ["linkId"], + "schemaTo": "public", + "tableTo": "MagicLink", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLinkStat_linkId_MagicLink_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MediaLibraryFile_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "MediaLibraryFolder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MediaLibraryFile_folderId_MediaLibraryFolder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MediaLibraryFolder_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_D2X0VlACjh0B_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_DlCmuyYqclNt_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_LwL2ykeZegup_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["createdBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MessagingAdOperation_createdBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_Q2FrBLiP3QqD_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_tLZC78O5pMBb_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_4ubezEjd9jQX_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessengerMessageTemplate_x0Vv1d8cvLYN_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCapiEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCapiEvent_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationMetaCatalogId"], + "schemaTo": "public", + "tableTo": "IntegrationMetaCatalog", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogItem_wJXyKUssR08y_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogItem_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogSyncRun_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["integrationMetaCatalogId"], + "schemaTo": "public", + "tableTo": "IntegrationMetaCatalog", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogSyncRun_8PnmCJ0uISUd_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["categoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MetaCatalogSyncRun_categoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Minigame_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": false, + "columns": ["minigameId"], + "schemaTo": "public", + "tableTo": "Minigame", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigameContact_minigameId_Minigame_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigameContact_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["referrerContactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MinigameContact_referrerContactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["minigameId"], + "schemaTo": "public", + "tableTo": "Minigame", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigamePlay_minigameId_Minigame_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigamePlay_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "PlatformCredential_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": false, + "columns": ["categoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Product_categoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["subcategoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Product_subcategoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Product_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductAddon_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductAddon" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductCategory_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": false, + "columns": ["parentId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductCategory_parentId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductVariant_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductVariant" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductVariantOption_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "nameExplicit": false, + "columns": ["submissionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireSubmission", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireAnswer_l8clOEM7NsPl_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": false, + "columns": ["questionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireQuestion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireAnswer_questionId_QuestionnaireQuestion_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": false, + "columns": ["triggerFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Questionnaire_triggerFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Questionnaire_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": false, + "columns": ["questionnaireId"], + "schemaTo": "public", + "tableTo": "Questionnaire", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireQuestion_questionnaireId_Questionnaire_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireQuestion_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["questionnaireId"], + "schemaTo": "public", + "tableTo": "Questionnaire", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_questionnaireId_Questionnaire_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireSubmission_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["currentQuestionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireQuestion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireSubmission_mha0bYFxcV7A_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "RefLinkStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": false, + "columns": ["linkId"], + "schemaTo": "public", + "tableTo": "Reflink", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "RefLinkStat_linkId_Reflink_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Reflink_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Reflink_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Reflink_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SavedReply_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SavedReply" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Sequence_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Sequence_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["stepId"], + "schemaTo": "public", + "tableTo": "SequenceStep", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_stepId_SequenceStep_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": ["enrollmentId", "workspaceId"], + "schemaTo": "public", + "tableTo": "ContactOnSequence", + "columnsTo": ["id", "workspaceId"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_enrollment_workspace_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "SequenceStep_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceStep_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Spreadsheet_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Tag_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Tag_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TagChannel_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TagChannel_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Template_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Template_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["createdBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Template_createdBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstallation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["templateId"], + "schemaTo": "public", + "tableTo": "Template", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_templateId_Template_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installFolderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_installFolderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installedBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_installedBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installationId"], + "schemaTo": "public", + "tableTo": "TemplateInstallation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstalledResource_a0BqwWeO96EB_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstalledResource_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Trigger_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Trigger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Condition_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": false, + "columns": ["webhookId"], + "schemaTo": "public", + "tableTo": "Webhook", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Condition_webhookId_Webhook_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerStat_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserDeviceToken_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserDeviceToken_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserPersistentMenu_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Webhook_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Webhook_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": false, + "columns": ["webhookId"], + "schemaTo": "public", + "tableTo": "Webhook", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_webhookId_Webhook_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappFlow_integrationWhatsappId_IntegrationWhatsapp_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappMessageTemplate_p6pSomUTTJCm_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Workspace_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Workspace_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMac_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMember_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMember_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "columns": ["aiTriggerId", "integrationOpenaiId"], + "nameExplicit": false, + "name": "AITriggerToIntegrationOpenai_pkey", + "entityType": "pks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsBotMessageEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "columns": [ + "broadcastId", + "contactInboxId", + "batchId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsBroadcastEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsContactEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsConversationEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "columns": [ + "flowId", + "analyticsId", + "nodeId", + "buttonId", + "contactInboxId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsFlowNodeEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsMessageEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "columns": [ + "sequenceId", + "stepId", + "contactInboxId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsSequenceEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "columns": ["id", "createdAt"], + "nameExplicit": false, + "name": "Attachment_pkey", + "entityType": "pks", + "schema": "public", + "table": "Attachment" + }, + { + "columns": ["workspaceId", "contactInboxId", "throttleType", "subjectId"], + "nameExplicit": true, + "name": "AutomationThrottle_pkey", + "entityType": "pks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "columns": ["workspaceId", "hourBucket", "contactInboxId"], + "nameExplicit": false, + "name": "ContactActiveHourly_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "columns": ["workspaceId", "periodStart", "contactInboxId"], + "nameExplicit": false, + "name": "ContactActiveMonthly_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "columns": ["broadcastId", "contactId"], + "nameExplicit": true, + "name": "ContactsOnBroadcast_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "columns": ["id", "workspaceId"], + "nameExplicit": true, + "name": "ContactOnSequence_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "columns": ["contactId", "tagId"], + "nameExplicit": false, + "name": "ContactToTag_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactToTag" + }, + { + "columns": ["tagChannelId", "contactInboxId"], + "nameExplicit": false, + "name": "ContactToTagChannel_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "columns": ["id", "createdAt"], + "nameExplicit": false, + "name": "Message_pkey", + "entityType": "pks", + "schema": "public", + "table": "Message" + }, + { + "columns": ["id", "workspaceId"], + "nameExplicit": true, + "name": "SequenceDispatch_pkey", + "entityType": "pks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "columns": ["id", "contactId"], + "nameExplicit": true, + "name": "TriggerContactHistory_pkey", + "entityType": "pks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessageShard_pkey", + "schema": "public", + "table": "MessageShard", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ShardTimeRange_pkey", + "schema": "public", + "table": "ShardTimeRange", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AdsConversionEvent_pkey", + "schema": "public", + "table": "AdsConversionEvent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AdsConversionRule_pkey", + "schema": "public", + "table": "AdsConversionRule", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIAgent_pkey", + "schema": "public", + "table": "AIAgent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIAssistant_pkey", + "schema": "public", + "table": "AIAssistant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIConversationEmbedding_pkey", + "schema": "public", + "table": "AIConversationEmbedding", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIConversationSource_pkey", + "schema": "public", + "table": "AIConversationSource", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIEmbedding_pkey", + "schema": "public", + "table": "AIEmbedding", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIFile_pkey", + "schema": "public", + "table": "AIFile", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIFunction_pkey", + "schema": "public", + "table": "AIFunction", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIMCPServer_pkey", + "schema": "public", + "table": "AIMCPServer", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AITrigger_pkey", + "schema": "public", + "table": "AITrigger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AnalyticsEmailTopic_pkey", + "schema": "public", + "table": "AnalyticsEmailTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Appointment_pkey", + "schema": "public", + "table": "Appointment", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendar_pkey", + "schema": "public", + "table": "AppointmentCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendarAvailability_pkey", + "schema": "public", + "table": "AppointmentCalendarAvailability", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendarReminder_pkey", + "schema": "public", + "table": "AppointmentCalendarReminder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentReminderDispatch_pkey", + "schema": "public", + "table": "AppointmentReminderDispatch", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Account_pkey", + "schema": "public", + "table": "Account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Invitation_pkey", + "schema": "public", + "table": "Invitation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Jwk_pkey", + "schema": "public", + "table": "Jwk", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Session_pkey", + "schema": "public", + "table": "Session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "User_pkey", + "schema": "public", + "table": "User", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Verification_pkey", + "schema": "public", + "table": "Verification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AutomatedResponse_pkey", + "schema": "public", + "table": "AutomatedResponse", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "BotField_pkey", + "schema": "public", + "table": "BotField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Broadcast_pkey", + "schema": "public", + "table": "Broadcast", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CoexistSyncRun_pkey", + "schema": "public", + "table": "CoexistSyncRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Contact_pkey", + "schema": "public", + "table": "Contact", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactCustomField_pkey", + "schema": "public", + "table": "ContactCustomField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactInbox_pkey", + "schema": "public", + "table": "ContactInbox", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactNote_pkey", + "schema": "public", + "table": "ContactNote", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactOnSmartDelay_pkey", + "schema": "public", + "table": "ContactOnSmartDelay", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Conversation_pkey", + "schema": "public", + "table": "Conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ConversationParticipant_pkey", + "schema": "public", + "table": "ConversationParticipant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Coupon_pkey", + "schema": "public", + "table": "Coupon", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CouponTopic_pkey", + "schema": "public", + "table": "CouponTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CustomField_pkey", + "schema": "public", + "table": "CustomField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "DynamicImage_pkey", + "schema": "public", + "table": "DynamicImage", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "EmailTopic_pkey", + "schema": "public", + "table": "EmailTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AuditLog_pkey", + "schema": "public", + "table": "AuditLog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CustomDomain_pkey", + "schema": "public", + "table": "CustomDomain", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Tenant_pkey", + "schema": "public", + "table": "Tenant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TenantHelpItem_pkey", + "schema": "public", + "table": "TenantHelpItem", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserQuota_pkey", + "schema": "public", + "table": "UserQuota", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceUsage_pkey", + "schema": "public", + "table": "WorkspaceUsage", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ErrorLog_pkey", + "schema": "public", + "table": "ErrorLog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ExternalWebhook_pkey", + "schema": "public", + "table": "ExternalWebhook", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FacebookLeadAdsAutomation_pkey", + "schema": "public", + "table": "FacebookLeadAdsAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FacebookLeadAdsLead_pkey", + "schema": "public", + "table": "FacebookLeadAdsLead", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FBCommentAutomation_pkey", + "schema": "public", + "table": "FBCommentAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FBCommentAutomationReply_pkey", + "schema": "public", + "table": "FBCommentAutomationReply", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "File_pkey", + "schema": "public", + "table": "File", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Flow_pkey", + "schema": "public", + "table": "Flow", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowAnalyticsSession_pkey", + "schema": "public", + "table": "FlowAnalyticsSession", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowNodeStat_pkey", + "schema": "public", + "table": "FlowNodeStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowRun_pkey", + "schema": "public", + "table": "FlowRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowVersion_pkey", + "schema": "public", + "table": "FlowVersion", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Folder_pkey", + "schema": "public", + "table": "Folder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IgStoryAutomation_pkey", + "schema": "public", + "table": "IgStoryAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Import_pkey", + "schema": "public", + "table": "Import", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Inbox_pkey", + "schema": "public", + "table": "Inbox", + "entityType": "pks" + }, + { + "columns": ["inboxId"], + "nameExplicit": false, + "name": "InboxContactStat_pkey", + "schema": "public", + "table": "InboxContactStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "InboxTeam_pkey", + "schema": "public", + "table": "InboxTeam", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "InboxTeamMember_pkey", + "schema": "public", + "table": "InboxTeamMember", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationActiveCampaign_pkey", + "schema": "public", + "table": "IntegrationActiveCampaign", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationApi_pkey", + "schema": "public", + "table": "IntegrationApi", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Integration_pkey", + "schema": "public", + "table": "Integration", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationClaude_pkey", + "schema": "public", + "table": "IntegrationClaude", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationDeepseek_pkey", + "schema": "public", + "table": "IntegrationDeepseek", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationDrip_pkey", + "schema": "public", + "table": "IntegrationDrip", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationFacebookAds_pkey", + "schema": "public", + "table": "IntegrationFacebookAds", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGemini_pkey", + "schema": "public", + "table": "IntegrationGemini", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGetResponse_pkey", + "schema": "public", + "table": "IntegrationGetResponse", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGoogleCalendar_pkey", + "schema": "public", + "table": "IntegrationGoogleCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGoogleSheet_pkey", + "schema": "public", + "table": "IntegrationGoogleSheet", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationInstagram_pkey", + "schema": "public", + "table": "IntegrationInstagram", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationKlaviyo_pkey", + "schema": "public", + "table": "IntegrationKlaviyo", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMailchimp_pkey", + "schema": "public", + "table": "IntegrationMailchimp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMailerLite_pkey", + "schema": "public", + "table": "IntegrationMailerLite", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMessenger_pkey", + "schema": "public", + "table": "IntegrationMessenger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMetaCatalog_pkey", + "schema": "public", + "table": "IntegrationMetaCatalog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMoosend_pkey", + "schema": "public", + "table": "IntegrationMoosend", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenai_pkey", + "schema": "public", + "table": "IntegrationOpenai", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenaiCompatible_pkey", + "schema": "public", + "table": "IntegrationOpenaiCompatible", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenrouter_pkey", + "schema": "public", + "table": "IntegrationOpenrouter", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOutlookCalendar_pkey", + "schema": "public", + "table": "IntegrationOutlookCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationSendGrid_pkey", + "schema": "public", + "table": "IntegrationSendGrid", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationSmtp_pkey", + "schema": "public", + "table": "IntegrationSmtp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationTelegram_pkey", + "schema": "public", + "table": "IntegrationTelegram", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationTiktok_pkey", + "schema": "public", + "table": "IntegrationTiktok", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationWebchat_pkey", + "schema": "public", + "table": "IntegrationWebchat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationWhatsapp_pkey", + "schema": "public", + "table": "IntegrationWhatsapp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationZalo_pkey", + "schema": "public", + "table": "IntegrationZalo", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MagicLink_pkey", + "schema": "public", + "table": "MagicLink", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MediaLibraryFile_pkey", + "schema": "public", + "table": "MediaLibraryFile", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MediaLibraryFolder_pkey", + "schema": "public", + "table": "MediaLibraryFolder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessageCleanup_pkey", + "schema": "public", + "table": "MessageCleanup", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessagingAdOperation_pkey", + "schema": "public", + "table": "MessagingAdOperation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessagingAdsConnection_pkey", + "schema": "public", + "table": "MessagingAdsConnection", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessengerMessageTemplate_pkey", + "schema": "public", + "table": "MessengerMessageTemplate", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCapiEvent_pkey", + "schema": "public", + "table": "MetaCapiEvent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCatalogItem_pkey", + "schema": "public", + "table": "MetaCatalogItem", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCatalogSyncRun_pkey", + "schema": "public", + "table": "MetaCatalogSyncRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Minigame_pkey", + "schema": "public", + "table": "Minigame", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MinigameContact_pkey", + "schema": "public", + "table": "MinigameContact", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MinigamePlay_pkey", + "schema": "public", + "table": "MinigamePlay", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "PlatformCredential_pkey", + "schema": "public", + "table": "PlatformCredential", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Product_pkey", + "schema": "public", + "table": "Product", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductAddon_pkey", + "schema": "public", + "table": "ProductAddon", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductCategory_pkey", + "schema": "public", + "table": "ProductCategory", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductVariant_pkey", + "schema": "public", + "table": "ProductVariant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductVariantOption_pkey", + "schema": "public", + "table": "ProductVariantOption", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireAnswer_pkey", + "schema": "public", + "table": "QuestionnaireAnswer", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Questionnaire_pkey", + "schema": "public", + "table": "Questionnaire", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireQuestion_pkey", + "schema": "public", + "table": "QuestionnaireQuestion", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireSubmission_pkey", + "schema": "public", + "table": "QuestionnaireSubmission", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Reflink_pkey", + "schema": "public", + "table": "Reflink", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SavedReply_pkey", + "schema": "public", + "table": "SavedReply", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Sequence_pkey", + "schema": "public", + "table": "Sequence", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SequenceStep_pkey", + "schema": "public", + "table": "SequenceStep", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Spreadsheet_pkey", + "schema": "public", + "table": "Spreadsheet", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SystemField_pkey", + "schema": "public", + "table": "SystemField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Tag_pkey", + "schema": "public", + "table": "Tag", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TagChannel_pkey", + "schema": "public", + "table": "TagChannel", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Template_pkey", + "schema": "public", + "table": "Template", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TemplateInstallation_pkey", + "schema": "public", + "table": "TemplateInstallation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TemplateInstalledResource_pkey", + "schema": "public", + "table": "TemplateInstalledResource", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Trigger_pkey", + "schema": "public", + "table": "Trigger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Condition_pkey", + "schema": "public", + "table": "Condition", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TriggerExecution_pkey", + "schema": "public", + "table": "TriggerExecution", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TriggerStat_pkey", + "schema": "public", + "table": "TriggerStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserDeviceToken_pkey", + "schema": "public", + "table": "UserDeviceToken", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserPersistentMenu_pkey", + "schema": "public", + "table": "UserPersistentMenu", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Webhook_pkey", + "schema": "public", + "table": "Webhook", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WebhookExecution_pkey", + "schema": "public", + "table": "WebhookExecution", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappCoexistStaging_pkey", + "schema": "public", + "table": "WhatsappCoexistStaging", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappFlow_pkey", + "schema": "public", + "table": "WhatsappFlow", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappMessageTemplate_pkey", + "schema": "public", + "table": "WhatsappMessageTemplate", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappSignupSession_pkey", + "schema": "public", + "table": "WhatsappSignupSession", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Workspace_pkey", + "schema": "public", + "table": "Workspace", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceMac_pkey", + "schema": "public", + "table": "WorkspaceMac", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceMember_pkey", + "schema": "public", + "table": "WorkspaceMember", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": ["contactInboxId", "sourceId", "createdAt"], + "nullsNotDistinct": false, + "name": "Message_source_dedup_idx", + "entityType": "uniques", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": ["workspaceId", "parentId", "name"], + "nullsNotDistinct": true, + "name": "ProductCategory_workspaceId_parent_name_key", + "entityType": "uniques", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": ["token"], + "nullsNotDistinct": false, + "name": "UserDeviceToken_token_key", + "entityType": "uniques", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": true, + "columns": ["workspaceId", "periodStart", "periodEnd"], + "nullsNotDistinct": false, + "name": "WorkspaceMac_workspaceId_periodStart_periodEnd_unique", + "entityType": "uniques", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "nullsNotDistinct": false, + "name": "UserQuota_userId_key", + "schema": "public", + "table": "UserQuota", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "nullsNotDistinct": false, + "name": "WorkspaceUsage_workspaceId_key", + "schema": "public", + "table": "WorkspaceUsage", + "entityType": "uniques" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"ctwaClid\" IS NOT NULL AND \"wabaId\" IS NOT NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL)", + "name": "AdsConversionEvent_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "value": "(\"registrationStatus\" <> 'failed' OR \"registrationError\" IS NOT NULL)\n AND (\"registrationStatus\" <> 'registered' OR \"registrationError\" IS NULL)", + "name": "IntegrationWhatsapp_registrationStatus_error_consistent", + "entityType": "checks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"integrationMessengerId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationMessengerId\" IS NULL)", + "name": "MessagingAdOperation_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"integrationMessengerId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationMessengerId\" IS NULL)", + "name": "MessagingAdsConnection_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "value": "\"channel\" IN ('messenger', 'instagram', 'whatsapp')", + "name": "MetaCapiEvent_channel_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "\"actionSource\" IN ('business_messaging', 'email', 'phone_call', 'chat', 'physical_store', 'system_generated', 'other')", + "name": "MetaCapiEvent_actionSource_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "\"contentType\" IN ('product', 'product_group')", + "name": "MetaCapiEvent_contentType_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "(\"customFieldId\" IS NULL) OR (\"systemFieldKey\" IS NULL)", + "name": "QuestionnaireQuestion_customFieldId_systemFieldKey_exclusive", + "entityType": "checks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "value": "cardinality(\"candidatePhoneNumberIds\") > 0", + "name": "WhatsappSignupSession_candidates_not_empty", + "entityType": "checks", + "schema": "public", + "table": "WhatsappSignupSession" + } + ], + "renames": [] +} diff --git a/packages/database/drizzle/20260903135251_add_capi_test_event_code/migration.sql b/packages/database/drizzle/20260903135251_add_capi_test_event_code/migration.sql new file mode 100644 index 0000000000..260f10ec44 --- /dev/null +++ b/packages/database/drizzle/20260903135251_add_capi_test_event_code/migration.sql @@ -0,0 +1,3 @@ +ALTER TABLE "IntegrationInstagram" ADD COLUMN "capiTestEventCode" text;--> statement-breakpoint +ALTER TABLE "IntegrationMessenger" ADD COLUMN "capiTestEventCode" text;--> statement-breakpoint +ALTER TABLE "IntegrationWhatsapp" ADD COLUMN "capiTestEventCode" text; \ No newline at end of file diff --git a/packages/database/drizzle/20260903135251_add_capi_test_event_code/snapshot.json b/packages/database/drizzle/20260903135251_add_capi_test_event_code/snapshot.json new file mode 100644 index 0000000000..78e3c8387d --- /dev/null +++ b/packages/database/drizzle/20260903135251_add_capi_test_event_code/snapshot.json @@ -0,0 +1,40563 @@ +{ + "version": "8", + "dialect": "postgres", + "id": "98af0348-8a2e-4edd-9a89-5af9ab84fc10", + "prevIds": ["da447af0-0dfe-46fe-9d54-ba3095bd9ee1"], + "ddl": [ + { + "values": [ + "pending", + "sent", + "failed", + "skipped_no_scope", + "skipped_region" + ], + "name": "adsConversionCapiStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["automatic", "rule", "trigger"], + "name": "adsConversionEventSource", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "facebook", "messenger", "instagram"], + "name": "adsConversionChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["lead", "purchase"], + "name": "adsConversionEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "success", "error", "processing"], + "name": "aiConversationEmbeddingStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "success", "error"], + "name": "aiConversationSourceStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["document", "image", "url", "web_search"], + "name": "aiConversationSourceType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "success", "error", "processing"], + "name": "aiEmbeddingStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["automated_response", "ai_agent", "flow", "none"], + "name": "analyticsBotResponseType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["success", "fallback"], + "name": "analyticsBotResult", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["flow", "agent", "fallback"], + "name": "analyticsBotRouteType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "message:sent", + "message:delivered", + "message:seen", + "message:failed", + "flow:clicked" + ], + "name": "analyticsBroadcastEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contact_created", "contact_deleted", "contact_blocked"], + "name": "analyticsContactEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["bot", "human"], + "name": "analyticsContactSenderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "conversation_created", + "conversation_assigned", + "conversation_unassigned", + "conversation_transferred_to_human", + "conversation_transferred_to_bot", + "conversation_followed", + "conversation_unfollowed", + "conversation_archived", + "conversation_unarchived" + ], + "name": "analyticsConversationEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["message_human_sent", "message_bot_sent"], + "name": "analyticsMessageEventType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["processing", "ingested", "failed"], + "name": "analyticsStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "synced", "failed"], + "name": "appointmentExternalSyncStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inPerson", "phoneCall", "onlineMeeting"], + "name": "appointmentLocationTypeSnapshot", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["scheduled", "cancelled"], + "name": "appointmentStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inPerson", "phoneCall", "onlineMeeting"], + "name": "appointmentLocationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["rollingDays", "dateRange", "specificDay", "anyFutureDate"], + "name": "appointmentScheduleWindowType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["minutes", "hours", "days"], + "name": "appointmentReminderTimingUnit", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "sent", "cancelled", "failed"], + "name": "appointmentReminderDispatchStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["image", "video", "audio", "gif", "file"], + "name": "fileType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inbound", "outbound"], + "name": "automatedResponseType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["defaultReply"], + "name": "automationThrottleType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["now", "future"], + "name": "broadcastScheduleType", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "scheduled", + "sent", + "sending", + "cancelled", + "draft", + "failed" + ], + "name": "broadcastStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "messenger", "instagram"], + "name": "coexistChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contacts", "messages"], + "name": "coexistMessengerSyncPhase", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["init", "running", "succeeded", "failed", "partial"], + "name": "coexistRunStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["male", "female", "unknown"], + "name": "gender", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "text", + "location", + "refLink", + "image", + "video", + "audio", + "gif", + "file" + ], + "name": "lastUserInputType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "scheduled", "completed", "failed", "canceled"], + "name": "ContactOnSmartDelayStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["waitNode", "followUp"], + "name": "ContactOnSmartDelayType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["active", "archived"], + "name": "couponTopicStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "shortText", + "email", + "phoneNumber", + "number", + "date", + "datetime", + "boolean", + "longText" + ], + "name": "customFieldType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["messenger", "instagram", "instagramFacebook"], + "name": "fbCommentAutomationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["import", "generic", "export"], + "name": "fileContextType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "uploaded", "failed"], + "name": "fileStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "tag", + "flow", + "customField", + "automatedResponse", + "trigger", + "webhook", + "sequence", + "emailTopic", + "fbComment", + "igComment", + "igStory", + "outboundAutomatedResponse" + ], + "name": "folderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["instagram", "instagramFacebook"], + "name": "igStoryAutomationType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["csv", "xlsx", "xls", "json"], + "name": "importFormat", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "completed", "failed"], + "name": "importStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["contacts", "coupons", "products", "flow"], + "name": "importType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["oauth", "fbe"], + "name": "metaCatalogAuthMode", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["active", "invalid"], + "name": "metaCatalogConnectionStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["idle", "queued", "running", "succeeded", "partial", "failed"], + "name": "metaCatalogImportStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending_verification", "registered", "failed"], + "name": "whatsappRegistrationStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["text", "location", "refLink"], + "name": "contentType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["message", "comment"], + "name": "messageKind", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["incoming", "outgoing", "activity"], + "name": "messageType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["bot", "contact", "system", "user", "api"], + "name": "senderType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "processing", "completed", "failed"], + "name": "MessageCleanupStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["whatsapp", "messenger", "instagram"], + "name": "messagingAdChannel", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "pending", + "campaignCreated", + "adSetCreated", + "creativeCreated", + "adCreated", + "failed" + ], + "name": "messagingAdCreateState", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "draft", + "publishing", + "published", + "pausing", + "paused", + "deleting", + "deleted", + "publishFailed" + ], + "name": "messagingAdPublishState", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["push", "import"], + "name": "metaCatalogItemDirection", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["all", "category", "selected"], + "name": "metaCatalogSyncScope", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["queued", "running", "succeeded", "partial", "failed"], + "name": "metaCatalogSyncStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["luckyWheel", "jackpot", "gashapon", "drawLots", "scratchOff"], + "name": "minigameType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["dont_track", "track"], + "name": "inventoryPolicy", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "text", + "number", + "email", + "phone", + "multipleChoice", + "date", + "datetime", + "image", + "file", + "location", + "websiteLink" + ], + "name": "questionnaireQuestionType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["inProgress", "completed", "cancelled", "failed", "timeout"], + "name": "questionnaireSubmissionStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["refLink", "qrCode"], + "name": "ReflinkType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["me"], + "name": "SystemFieldType", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["pending", "installing", "completed", "partial", "failed"], + "name": "templateInstallationStatus", + "entityType": "enums", + "schema": "public" + }, + { + "values": [ + "flows", + "products", + "aiFunctions", + "aiAgents", + "calendars", + "webchats", + "keywords", + "entryPointLinks", + "triggers", + "fbCommentAutomations", + "settings", + "customFields", + "tags", + "productCategories" + ], + "name": "templateResourceCategory", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["ios", "android"], + "name": "devicePlatform", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["allTime", "oncePerHour", "oncePerDay"], + "name": "defaultReplyFrequency", + "entityType": "enums", + "schema": "public" + }, + { + "values": ["owner", "agent"], + "name": "workspaceMemberRole", + "entityType": "enums", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessageShard", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ShardTimeRange", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AdsConversionEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AdsConversionRule", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIAgent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIAssistant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIConversationEmbedding", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIConversationSource", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIEmbedding", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIFile", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIFunction", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AIMCPServer", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AITrigger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AITriggerToIntegrationOpenai", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsBotMessageEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsBroadcastEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsContactEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsConversationEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsFlowNodeEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsMessageEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsSequenceEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsEmailTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AnalyticsManifestStatus", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Appointment", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendarAvailability", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentCalendarReminder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AppointmentReminderDispatch", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Attachment", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Account", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Invitation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Jwk", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Session", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "User", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Verification", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AutomatedResponse", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AutomationThrottle", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "BotField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Broadcast", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CoexistSyncRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Contact", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactActiveHourly", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactActiveMonthly", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactCustomField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactInbox", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactNote", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnBroadcast", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnSequence", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactOnSmartDelay", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactToTag", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ContactToTagChannel", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Conversation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ConversationParticipant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Coupon", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CouponTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CustomField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "DynamicImage", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "EmailTopic", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "AuditLog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "CustomDomain", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Tenant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TenantHelpItem", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserQuota", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceUsage", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ErrorLog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ExternalWebhook", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FacebookLeadAdsAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FacebookLeadAdsLead", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FBCommentAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FBCommentAutomationReply", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "File", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Flow", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowAnalyticsSession", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowNodeStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "FlowVersion", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Folder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IgStoryAutomation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Import", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Inbox", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxContactStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxTeam", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "InboxTeamMember", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationActiveCampaign", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationApi", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Integration", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationClaude", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationDeepseek", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationDrip", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationFacebookAds", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGemini", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGetResponse", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGoogleCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationGoogleSheet", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationInstagram", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationKlaviyo", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMailchimp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMailerLite", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMessenger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMetaCatalog", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationMoosend", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenai", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenaiCompatible", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOpenrouter", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationOutlookCalendar", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationSendGrid", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationSmtp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationTelegram", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationTiktok", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationWebchat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationWhatsapp", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "IntegrationZalo", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MagicLink", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MagicLinkStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MediaLibraryFile", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MediaLibraryFolder", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Message", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessageCleanup", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessagingAdOperation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessagingAdsConnection", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MessengerMessageTemplate", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCapiEvent", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCatalogItem", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MetaCatalogSyncRun", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Minigame", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MinigameContact", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "MinigamePlay", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "PlatformCredential", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Product", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductAddon", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductCategory", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductVariant", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "ProductVariantOption", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireAnswer", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Questionnaire", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireQuestion", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "QuestionnaireSubmission", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "RefLinkStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Reflink", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SavedReply", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Sequence", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SequenceDispatch", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SequenceStep", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Spreadsheet", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "SystemField", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Tag", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TagChannel", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Template", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TemplateInstallation", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TemplateInstalledResource", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Trigger", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Condition", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerContactHistory", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerExecution", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "TriggerStat", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserDeviceToken", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "UserPersistentMenu", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Webhook", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WebhookExecution", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappCoexistStaging", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappFlow", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappMessageTemplate", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WhatsappSignupSession", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "Workspace", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceMac", + "entityType": "tables", + "schema": "public" + }, + { + "isRlsEnabled": false, + "name": "WorkspaceMember", + "entityType": "tables", + "schema": "public" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "host", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "5432", + "generated": null, + "identity": null, + "name": "port", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "database", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "user", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "credentialRef", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'disable'", + "generated": null, + "identity": null, + "name": "sslMode", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isMain", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shardKey", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "readHost", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "readPort", + "entityType": "columns", + "schema": "public", + "table": "MessageShard" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shardId", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'whatsapp'", + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionEventSource", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ctwaClid", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "orderId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contents", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceEventId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "adsConversionCapiStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "capiStatus", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiSentAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "adsConversionChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationFacebookAdsId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adAccountId", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "adsConversionEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "trigger", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "markAs", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isDefault", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isRichResponse", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "tools", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "webSearchAuthorizedDomains", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "models", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "AIAgent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "aiTriggerIds", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "attachmentIds", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "AIAssistant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "chunkIndex", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "vector(1536)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "embedding", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "aiConversationEmbeddingStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attachmentId", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "aiConversationSourceType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceType", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "aiConversationSourceStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceKey", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentHash", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "summary", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "AIConversationSource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "content", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "vector(1536)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "embedding", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "aiEmbeddingStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiFileId", + "entityType": "columns", + "schema": "public", + "table": "AIEmbedding" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "purpose", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "dataCollect", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "outputMessage", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerFlowId", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIFunction" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "availableTools", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "selectedTools", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AIMCPServer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "questions", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finalMessage", + "entityType": "columns", + "schema": "public", + "table": "AITrigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiTriggerId", + "entityType": "columns", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationOpenaiId", + "entityType": "columns", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasResponse", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotResponseType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "responseType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotRouteType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "routeType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "analyticsBotResult", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "result", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiProvider", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "analyticsBroadcastEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "batchId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "analyticsContactEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "analyticsContactSenderType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "analyticsConversationEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fromAssignee", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "toAssignee", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "analyticsId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "buttonId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "analyticsMessageEventType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "analyticsContactSenderType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "insertedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "topicId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstSeenAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSeenAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "seenCount", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstClickedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastClickedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "clickCount", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "objectKey", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "analyticsStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "timestamp", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ingestedAt", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inviteeTimezone", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'scheduled'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentLocationTypeSnapshot", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationType", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationDetail", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalEventId", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "appointmentExternalSyncStatus", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalSyncStatus", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Appointment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "30", + "generated": null, + "identity": null, + "name": "durationMinutes", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "bufferAfterMinutes", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "appointmentLocationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationType", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locationDetail", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "appointmentScheduleWindowType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'rollingDays'", + "generated": null, + "identity": null, + "name": "scheduleWindowType", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "scheduleWindowConfig", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxAppointmentsPerUser", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "dailyLimitEnabled", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxPerDay", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowGroupMeeting", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxPerSlot", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "confirmationMessage", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "confirmationFlowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancellationFlowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalConnectionId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicLinkSlug", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "weekday", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startMinute", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endMinute", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "calendarId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timingValue", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "appointmentReminderTimingUnit", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timingUnit", + "entityType": "columns", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appointmentId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "reminderConfigId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "appointmentReminderDispatchStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "jobId", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sentAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedReason", + "entityType": "columns", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageCreatedAt", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "fileType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileType", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "width", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "height", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "thumbnailPath", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "originPath", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Attachment" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accountId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "providerId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accessToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accessTokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refreshToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refreshTokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idToken", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "password", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Account" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "invitedBy", + "entityType": "columns", + "schema": "public", + "table": "Invitation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicKey", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "privateKey", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Jwk" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ipAddress", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userAgent", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Session" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailVerified", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isAnonymous", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "mustChangePassword", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "User" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "identifier", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "Verification" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "keywords", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "automatedResponseType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'inbound'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "automationThrottleType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "throttleType", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subjectId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "lastTriggeredAt", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "uuid", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "claimId", + "entityType": "columns", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "customFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "BotField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateId", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateData", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "broadcastStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "broadcastScheduleType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schedulesType", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "schedulesAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactFilter", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subaction", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactCount", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "handoffCompletedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "resumeCount", + "entityType": "columns", + "schema": "public", + "table": "Broadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistRunStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'init'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerSource", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finishedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastHeartbeatAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalScan", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentScan", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedAt", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentPageNumber", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedContactCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedMessageCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "skippedCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentError", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastPhase", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastChunkOrder", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "syncProgress", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "coexistMessengerSyncPhase", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'contacts'", + "generated": null, + "identity": null, + "name": "messengerSyncPhase", + "entityType": "columns", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "avatar", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumber", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "emailVerified", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "emailOptIn", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "CASE\n WHEN \"firstName\" IS NULL AND \"lastName\" IS NULL THEN NULL\n WHEN \"firstName\" IS NULL THEN \"lastName\"\n WHEN \"lastName\" IS NULL THEN \"firstName\"\n ELSE \"firstName\" || ' ' || \"lastName\"\n END", + "type": "stored" + }, + "identity": null, + "name": "fullName", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "gender", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "gender", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ref", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "country", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "state", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "city", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "location", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "locale", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subscribedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastSubscribedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "blockedAt", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Contact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hourBucket", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceMacId", + "entityType": "columns", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "ContactCustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "originalContactId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "personaId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstInteractionAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastIncomingMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastOutboundMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referral", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastCommentMessageId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastCommentMessageAt", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "consecutiveFailedReply", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastInputFailure", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastErrorLog", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastBtnTitle", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUserInput", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "lastUserInputType", + "typeSchema": "public", + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUserInputType", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webchatParentUrl", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUserId", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUsername", + "entityType": "columns", + "schema": "public", + "table": "ContactInbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdById", + "entityType": "columns", + "schema": "public", + "table": "ContactNote" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "broadcastId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "sent", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "clickedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "case when \"seenAt\" is null then false when \"deliveredAt\" is null then false else \"seenAt\" >= \"deliveredAt\" end", + "type": "stored" + }, + "identity": null, + "name": "isRead", + "entityType": "columns", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "enrolledAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nextRunAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastStepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nextStepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockedAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockOwner", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowVersionId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appointmentId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metadata", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "ContactOnSmartDelayType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerAt", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "ContactOnSmartDelayStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagChannelId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "botEnabled", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botResumeAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "archivedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "additionalAttributes", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "agentLastReadAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiContextLastMessageId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastActivityAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "followed", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "assignedUserId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "assignedInboxTeamId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastStep", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentStep", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adminRepliedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactRepliedAt", + "entityType": "columns", + "schema": "public", + "table": "Conversation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "topicId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "code", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuedContactId", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "issuedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "usedAt", + "entityType": "columns", + "schema": "public", + "table": "Coupon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "couponTopicStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasEverHadCoupon", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdById", + "entityType": "columns", + "schema": "public", + "table": "CouponTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "customFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "showInInbox", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "CustomField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "data", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "backgroundUrl", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "DynamicImage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "sendsTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "deliveredsTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "seensTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "clicksTotal", + "entityType": "columns", + "schema": "public", + "table": "EmailTopic" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "detail", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ipAddress", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userAgent", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "AuditLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "domain", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verifiedAt", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfHostnameId", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfOwnershipValue", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cfAcmeValue", + "entityType": "columns", + "schema": "public", + "table": "CustomDomain" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "disabledReason", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brandName", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logoLightPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logoDarkPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "faviconPath", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customCss", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customJs", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "theme", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storageUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "policyUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "termsOfServiceUrl", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "signupEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "forgotPasswordEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "magicLinkEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "accountCredentialsEmailTemplate", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "hiddenChannels", + "entityType": "columns", + "schema": "public", + "table": "Tenant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "icon", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactsLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "contactsUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspacesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "workspacesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelsLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "channelsUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "teamMembersLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "teamMembersUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "macLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botMessagesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "monthlyBotMessagesLimit", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "monthlyBotMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "monthlyBotMessagesPeriodStart", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesTopUpGranted", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "whiteLabel", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "ssoSaml", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "saasMode", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "planName", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "planStatus", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "selectedTrialPlanId", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodEnd", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelsTornDownAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "syncedAt", + "entityType": "columns", + "schema": "public", + "table": "UserQuota" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "contactsUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "channelsUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "teamMembersUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "botMessagesUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macUsed", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "syncedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "action", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "detail", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "httpCode", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "ErrorLog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'make'", + "generated": null, + "identity": null, + "name": "provider", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "event", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageName", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formName", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "fieldMapping", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "leadsHandledCount", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automationId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "leadgenId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "fbCommentAutomationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'messenger'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "repliesCount", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "post", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"text\",\"value\":\"\"}'", + "generated": null, + "identity": null, + "name": "privateReply", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"none\",\"value\":null}'", + "generated": null, + "identity": null, + "name": "publicReply", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "includeKeywords", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "ARRAY[]", + "generated": null, + "identity": null, + "name": "excludeKeywords", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"replyToNewContactsOnly\":false,\"replyOncePerUserPerPost\":false,\"likeUserComment\":false,\"replyToUsersWhoCommentedOnOtherPosts\":true,\"ignoreCommentReplies\":true,\"trackUserTags\":false}'", + "generated": null, + "identity": null, + "name": "options", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"all\":false,\"hasPhoneNumber\":false,\"hasImage\":false,\"hasVideo\":false,\"hasLink\":false,\"hasKeywords\":false,\"keywords\":[],\"showCommentsAfter\":\"none\"}'", + "generated": null, + "identity": null, + "name": "hideComments", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"immediately\",\"value\":0}'", + "generated": null, + "identity": null, + "name": "replyAfter", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "automationId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "postId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "fileContextType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contextType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileName", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileSize", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "fileStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "meta", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "uploadedAt", + "entityType": "columns", + "schema": "public", + "table": "File" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enableInInbox", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentVersionId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "draftVersionId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Flow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "analyticsId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nodeId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "buttonId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventType", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refId", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "refType", + "entityType": "columns", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowVersionId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "FlowRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "nodes", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "edges", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isDraft", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isLatest", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startNodeId", + "entityType": "columns", + "schema": "public", + "table": "FlowVersion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "folderType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderType", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isTrash", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "paths", + "entityType": "columns", + "schema": "public", + "table": "Folder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "igStoryAutomationType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "repliesCount", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "story", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"none\",\"value\":null}'", + "generated": null, + "identity": null, + "name": "reply", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{\"type\":\"all\",\"value\":[]}'", + "generated": null, + "identity": null, + "name": "includeKeywords", + "entityType": "columns", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fileId", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importFormat", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "format", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "importStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "meta", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "processedCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "successCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "errorSample", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "Import" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'connected'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "Inbox" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalContacts", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxContactStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "InboxTeam" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxTeamId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenHash", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenPrefix", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "callbackUrl", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationApi" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationType", + "entityType": "columns", + "schema": "public", + "table": "Integration" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'primary'", + "generated": null, + "identity": null, + "name": "providerCalendarId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userInfo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "igId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "username", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiTestEventCode", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'instagram'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userInfo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pageId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "personas", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "personaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiTestEventCode", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "syncTagEnabledAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogName", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "encryptedAuth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogAuthMode", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'oauth'", + "generated": null, + "identity": null, + "name": "authMode", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogConnectionStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "metaCatalogImportStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'idle'", + "generated": null, + "identity": null, + "name": "importStatus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importTotalCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importedCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "importFailedCount", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "importError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastImportedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'VND'", + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "storeUrl", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReplyVoice", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "voice", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiAssistantId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "aiAgentId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "baseURL", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultModel", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "preset", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoReply", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "maxOutputTokens", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "model", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prompt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "temperature", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'primary'", + "generated": null, + "identity": null, + "name": "providerCalendarId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "email", + "entityType": "columns", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fromAddress", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "botId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enable", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "authorizedDomains", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "conversationStarters", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "persistentMenus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "brandColor", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hideHeader", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "showLogo", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hideMessageInput", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customCss", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "welcomeFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumberId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "displayPhoneNumber", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistEnabled", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "coexistAiReadsSyncedHistory", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isCoexist", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "platformType", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "historyDeclined", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "hasCapiScope", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiScopeCheckedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "datasetId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiAccessToken", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiDisconnectedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiTestEventCode", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "whatsappRegistrationStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending_verification'", + "generated": null, + "identity": null, + "name": "registrationStatus", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "registrationError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verificationCodeRequestedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "oaId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "fallbackFlowId", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "syncTagEnabledAt", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tokenRefreshError", + "entityType": "columns", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "MagicLink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linkId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "path", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "mimeType", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "size", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isFavourite", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastAccessedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentAttributes", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "messageType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "messageType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "contentType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "senderType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderType", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "senderId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "timestamp with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "messageKind", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'message'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "attributes", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendError", + "entityType": "columns", + "schema": "public", + "table": "Message" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "inboxId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationIds", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sinceTime", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "MessageCleanupStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempts", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processedAt", + "entityType": "columns", + "schema": "public", + "table": "MessageCleanup" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "adAccountId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdCreateState", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "createState", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "messagingAdPublishState", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'draft'", + "generated": null, + "identity": null, + "name": "publishState", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaCampaignId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdSetId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdCreativeId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "metaAdId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "input", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cleanupError", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdBy", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "messagingAdChannel", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationInstagramId", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "auth", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'active'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMessengerId", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'POSITIONAL'", + "generated": null, + "identity": null, + "name": "parameterFormat", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "components", + "entityType": "columns", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channel", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "eventName", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentCategory", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentName", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "numeric", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'business_messaging'", + "generated": null, + "identity": null, + "name": "actionSource", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentType", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contentIds", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "source", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceKey", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "capiStatus", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiSentAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "capiError", + "entityType": "columns", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMetaCatalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "metaCatalogItemDirection", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'push'", + "generated": null, + "identity": null, + "name": "direction", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retailerId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedFingerprint", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastSyncedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationMetaCatalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogSyncStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'queued'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogItemDirection", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'push'", + "generated": null, + "identity": null, + "name": "direction", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "catalogId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "metaCatalogSyncScope", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'all'", + "generated": null, + "identity": null, + "name": "scope", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "selectedProductIds", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "handles", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "submissionLeaseId", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "succeededCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failedCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "skippedCount", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "itemErrors", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "skippedItems", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "pollAttempt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "error", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "finishedAt", + "entityType": "columns", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "minigameType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enabled", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "generalSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "appearance", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "playerSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "winningMessageSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "nonWinningMessageSettings", + "entityType": "columns", + "schema": "public", + "table": "Minigame" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minigameId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "openedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "played", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "remaining", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "referrerContactId", + "entityType": "columns", + "schema": "public", + "table": "MinigameContact" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "minigameId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "isWinning", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeId", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "prizeName", + "entityType": "columns", + "schema": "public", + "table": "MinigamePlay" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publicConfig", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "livemode", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "usePlatformCredential", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isVerified", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "verifiedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastUsedAt", + "entityType": "columns", + "schema": "public", + "table": "PlatformCredential" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shortDescription", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "longDescription", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "price", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "taxes", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "discount", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'USD'", + "generated": null, + "identity": null, + "name": "currency", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productUrl", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sku", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "inventoryPolicy", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'dont_track'", + "generated": null, + "identity": null, + "name": "inventoryPolicy", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "inventoryQuantity", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowOutOfStockPurchase", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "images", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "tags", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "vendor", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "rank", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "subcategoryId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isSearchable", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "allowSpecialRequest", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "isAddonOnly", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Product" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "''", + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "maxSelections", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "addonProductIds", + "entityType": "columns", + "schema": "public", + "table": "ProductAddon" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "parentId", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "rank", + "entityType": "columns", + "schema": "public", + "table": "ProductCategory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "combination", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "double precision", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "price", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isEnabled", + "entityType": "columns", + "schema": "public", + "table": "ProductVariant" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "productId", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "values", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "10", + "generated": null, + "identity": null, + "name": "position", + "entityType": "columns", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "submissionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionIdSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionTitleSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionTypeSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "labelSnapshot", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "pointsEarned", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "attemptCount", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "answeredAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "enableScore", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "enableRetryMessages", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "enableCustomFieldMapping", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerFlowId", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Questionnaire" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionnaireId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "title", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "questionnaireQuestionType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "image", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "orderNo", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "point", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "retryMessage", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "systemFieldKey", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "config", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "questionnaireId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "conversationId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "questionnaireSubmissionStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'inProgress'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "totalPoints", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentQuestionId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "currentQuestionSentAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastAnsweredMessageId", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "startedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "cancelledAt", + "entityType": "columns", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "linkId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "occurredAt", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "RefLinkStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "ReflinkType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'refLink'", + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "customFieldId", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "qrStyles", + "entityType": "columns", + "schema": "public", + "table": "Reflink" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shortcut", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "text", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "SavedReply" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "subscribers", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "messages", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Sequence" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "runAtMs", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "bucket", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "idempotencyKey", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "attempt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lastError", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "lockOwner", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deliveredAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "seenAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "clickedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "failedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorContent", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactInboxId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "stepId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "enrollmentId", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": { + "as": "case when \"seenAt\" is null then false when \"deliveredAt\" is null then false else \"seenAt\" >= \"deliveredAt\" end", + "type": "stored" + }, + "identity": null, + "name": "isRead", + "entityType": "columns", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "order", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delayDays", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "delayMinutes", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "delayUnit", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "specificDateTime", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "anytime", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendTimeStart", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sendTimeEnd", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": "'[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\"]'", + "generated": null, + "identity": null, + "name": "sendDays", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "flowId", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sequenceId", + "entityType": "columns", + "schema": "public", + "table": "SequenceStep" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "spreadsheetId", + "entityType": "columns", + "schema": "public", + "table": "Spreadsheet" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "SystemFieldType", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "SystemField" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Tag" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tagId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "channelType", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "externalLabelId", + "entityType": "columns", + "schema": "public", + "table": "TagChannel" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "description", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "imageUrl", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "publisherName", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "youtubeVideoId", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "testLink", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "selection", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "categoryCounts", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formatVersion", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shareToken", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "shareEnabled", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "shareExpiresAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultPermissions", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "createInstallFolder", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "defaultAutoUpdate", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "installCount", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "createdBy", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "deletedAt", + "entityType": "columns", + "schema": "public", + "table": "Template" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "templateName", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceWorkspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "formatVersion", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "templateInstallationStatus", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'pending'", + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "warnings", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "warningCount", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "errorMessage", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "resourceCount", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installFolderId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "autoUpdate", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceUpdatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installedBy", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "completedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "installationId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "templateResourceCategory", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resourceKind", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "resourceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceResourceId", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "wasExisting", + "entityType": "columns", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": "", + "generated": null, + "identity": null, + "name": "actions", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Trigger" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webhookId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "type", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "varchar(255)", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "operator", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "value", + "entityType": "columns", + "schema": "public", + "table": "Condition" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "firstEnteredAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "executedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "triggerId", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "date", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalContacts", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "successCount", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "failureCount", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "totalExecutions", + "entityType": "columns", + "schema": "public", + "table": "TriggerStat" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "devicePlatform", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "platform", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "lastSeenAt", + "entityType": "columns", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "", + "generated": null, + "identity": null, + "name": "menus", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "active", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "folderId", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "url", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "Webhook" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "executedAt", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "webhookId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "contactId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WebhookExecution" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "phoneNumberId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payload", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "payloadHash", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "processedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "categories", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "validationErrors", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "completedCount", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "screens", + "entityType": "columns", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "integrationWhatsappId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "sourceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "category", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "status", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'[]'", + "generated": null, + "identity": null, + "name": "components", + "entityType": "columns", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "wabaId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "businessId", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "encryptedAccessToken", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "apiVersion", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 1, + "default": null, + "generated": null, + "identity": null, + "name": "candidatePhoneNumberIds", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "expiresAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "consumedAt", + "entityType": "columns", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "name", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "defaultReply", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "defaultReplyFrequency", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": "'allTime'", + "generated": null, + "identity": null, + "name": "defaultReplyFrequency", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "targetCountry", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'en'", + "generated": null, + "identity": null, + "name": "language", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'UTC'", + "generated": null, + "identity": null, + "name": "timezone", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'#016DFF'", + "generated": null, + "identity": null, + "name": "brandColor", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "developmentMode", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "smartResponseDelaySeconds", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "true", + "generated": null, + "identity": null, + "name": "isActive", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "startTime", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "endTime", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "logo", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "scheduledDeletionAt", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "boolean", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "false", + "generated": null, + "identity": null, + "name": "capiLimitedDataUse", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "ownerId", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "1", + "generated": null, + "identity": null, + "name": "tenantId", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "text", + "typeSchema": null, + "notNull": false, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "token", + "entityType": "columns", + "schema": "public", + "table": "Workspace" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodStart", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "periodEnd", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "integer", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "0", + "generated": null, + "identity": null, + "name": "macCount", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "id", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "createdAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "timestamp(6) with time zone", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "now()", + "generated": null, + "identity": null, + "name": "updatedAt", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "workspaceId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "bigint", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "userId", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "workspaceMemberRole", + "typeSchema": "public", + "notNull": true, + "dimensions": 0, + "default": null, + "generated": null, + "identity": null, + "name": "role", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notificationChannels", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "notificationTypes", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "type": "jsonb", + "typeSchema": null, + "notNull": true, + "dimensions": 0, + "default": "'{}'", + "generated": null, + "identity": null, + "name": "permissions", + "entityType": "columns", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "isActive", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageShard_isActive_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageShard" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shardKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageShard_shardKey_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageShard" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "startTime", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "endTime", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ShardTimeRange_time_lookup_idx", + "entityType": "indexes", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shardId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ShardTimeRange_shardId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspace_integration_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'whatsapp'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_whatsapp_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'messenger'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_messenger_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "source", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceEventId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"channel\" = 'instagram'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_ws_instagram_source_sourceEventId_key", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionEvent_workspaceId_adId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "enabled", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AdsConversionRule_workspaceId_channel_enabled_idx", + "entityType": "indexes", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_sourceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "chunkIndex", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_sourceId_chunkIndex_key", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "embedding", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "vector_cosine_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "hnsw", + "concurrently": false, + "name": "AIConversationEmbedding_embedding_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationEmbedding_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_lookup_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_workspaceId_sourceType_sourceKey_key", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "messageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_messageId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIConversationSource_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AIEmbedding_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "aiProvider", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_aiProvider_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "hasResponse", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "result", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBotMessageEvent_workspaceId_hasResponse_result_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "broadcastId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsBroadcastEvent_workspaceId_broadcastId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adminId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsContactEvent_workspaceId_adminId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsConversationEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "toAssignee", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsConversationEvent_workspaceId_toAssignee_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsFlowNodeEvent_workspaceId_flowId_analyticsId_nodeId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "buttonId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsFlowNodeEvent_workspaceId_flowId_analyticsId_nodeId_buttonId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_occurredAt_eventType_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "adminId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_adminId_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "senderType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsMessageEvent_workspaceId_senderType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsSequenceEvent_workspaceId_sequenceId_stepId_eventType_occurredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "token", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_token_key", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsEmailTopic_workspaceId_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "objectKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AnalyticsManifestStatus_objectKey_key", + "entityType": "indexes", + "schema": "public", + "table": "AnalyticsManifestStatus" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "startAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_workspaceId_startAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "startAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_calendarId_status_startAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Appointment_contactId_calendarId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "publicLinkSlug", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendar_publicLinkSlug_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendarAvailability_calendarId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "calendarId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "timingValue", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "timingUnit", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentCalendarReminder_dedupe_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "jobId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_jobId_key", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sendAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_status_sendAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "appointmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_appointmentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AppointmentReminderDispatch_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "messageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "messageCreatedAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_message_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_workspaceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Attachment_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Attachment" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "providerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "accountId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Account_providerId_accountId_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Invitation_code_key", + "entityType": "indexes", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "token", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Session_token_key", + "entityType": "indexes", + "schema": "public", + "table": "Session" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "User_email_tenant_key", + "entityType": "indexes", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "User_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AutomatedResponse_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lastTriggeredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AutomationThrottle_lastTriggeredAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "BotField_workspaceId_type_name_key", + "entityType": "indexes", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_channel_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "schedulesAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_schedulesAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"deletedAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Broadcast_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_workspace_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastHeartbeatAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "status IN ('init', 'running')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "\"startedAt\" DESC", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "status IN ('succeeded', 'partial')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_resume_idx", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "status = 'init'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CoexistSyncRun_integration_init_uq", + "entityType": "indexes", + "schema": "public", + "table": "CoexistSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "broadcastSubscribedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_broadcast_subscribed_at", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_workspace_created_at", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "firstName", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_firstName_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "lastName", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_lastName_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "email", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_email_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumber", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": { + "name": "gin_trgm_ops", + "default": false + } + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "gin", + "concurrently": false, + "name": "Contact_phoneNumber_trgm_idx", + "entityType": "indexes", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactCustomField_contactId_customFieldId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactCustomField_customFieldId_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_inboxId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceUserId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceUserId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_inboxId_sourceUserId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastIncomingMessageAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_contactId_lastIncomingMessageAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastOutboundMessageAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_contactId_lastOutboundMessageAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "(\"referral\"->>'ctwaClid')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"referral\"->>'ctwaClid' IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_referral_ctwaClid_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "(\"referral\"->>'adId')", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"referral\"->>'adId' IS NOT NULL AND \"referral\"->>'source' = 'ADS'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactInbox_referral_adId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactNote_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_on_broadcast_contact_id", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "isRead", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "idx_contact_on_broadcast_is_read", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "broadcastId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"sent\" = false AND \"failedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnBroadcast_unsent_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_sequenceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nextRunAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_status_nextRunAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nextRunAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_workspaceId_status_nextRunAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactsOnSequence_contactId_sequenceId_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_workspaceId_flowId_contactInboxId_stepId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "triggerAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_status_triggerAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "appointmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_appointmentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" NOT IN ('completed', 'failed', 'canceled') AND \"type\" = 'followUp'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactOnSmartDelay_followUp_active_key", + "entityType": "indexes", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactToTagChannel_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tagId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ContactToTagChannel_tagId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_contactId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"sourceId\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_contactId_dm_key", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "aiContextLastMessageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_aiContextLastMessageId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lastActivityAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Conversation_workspaceId_lastActivityAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ConversationParticipant_conversationId_userId_key", + "entityType": "indexes", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_code_key", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"issuedContactId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_key", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_issuedContactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "issuedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_issuedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "usedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_usedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "code", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_code_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "topicId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "issuedContactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "usedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Coupon_workspaceId_topicId_issuedContactId_usedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_status_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "expiresAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_expiresAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "lower(\"name\")", + "isExpression": true, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"deletedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "CouponTopic_workspaceId_name_idx", + "entityType": "indexes", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomField_workspaceId_type_name_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "DynamicImage_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "EmailTopic_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "EmailTopic_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "AuditLog_workspaceId_createdAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"userId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "AuditLog_workspaceId_userId_createdAt_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_tenantId_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "domain", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_domain_key", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "CustomDomain_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "ownerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tenant_ownerId_key", + "entityType": "indexes", + "schema": "public", + "table": "Tenant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "position", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TenantHelpItem_tenantId_position_idx", + "entityType": "indexes", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelsTornDownAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserQuota_channelsTornDownAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"channelsTornDownAt\" IS NULL AND \"planStatus\" = 'trial'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserQuota_due_expired_trial_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": true, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_workspaceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ErrorLog_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "event", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ExternalWebhook_workspaceId_event_idx", + "entityType": "indexes", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "event", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "url", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ExternalWebhook_workspaceId_event_url_key", + "entityType": "indexes", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "pageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "formId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsAutomation_workspaceId_pageId_formId_key", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "automationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "leadgenId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsLead_automationId_leadgenId_key", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "leadgenId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FacebookLeadAdsLead_leadgenId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomation_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "automationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "postId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomationReply_dedup_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FBCommentAutomationReply_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "path", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_path_key", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contextType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_workspaceId_contextType_idx", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "subType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "File_workspaceId_subType_idx", + "entityType": "indexes", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"deletedAt\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowAnalyticsSession_workspaceId_flowId_key", + "entityType": "indexes", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowAnalyticsSession_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowAnalyticsSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "eventType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "buttonId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowNodeStat_filter_1_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "analyticsId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "nodeId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"eventType\" = 'seen' AND \"seenAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowNodeStat_filter_2_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "FlowRun_conversationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Folder_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Folder_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IgStoryAutomation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IgStoryAutomation_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_workspaceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_workspaceId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_inboxId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "fileId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_fileId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"type\" = 'products' AND \"status\" IN ('pending', 'processing')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Import_products_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Inbox_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Inbox_workspaceId_channel_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationActiveCampaign_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationActiveCampaign_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tokenHash", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationApi_tokenHash_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Integration_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Integration_workspaceId_integrationType_key", + "entityType": "indexes", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationClaude_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationClaude_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDeepseek_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDeepseek_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDrip_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationDrip_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationFacebookAds_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationFacebookAds_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGemini_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGemini_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGetResponse_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGetResponse_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGoogleCalendar_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationGoogleSheet_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "igId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationInstagram_igId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationKlaviyo_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationKlaviyo_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailchimp_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailchimp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailerLite_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMailerLite_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "pageId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMessenger_pageId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "deletedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMetaCatalog_deletedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMoosend_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationMoosend_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenAI_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "preset", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"preset\" <> 'custom'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenaiCompatible_workspaceId_preset_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenrouter_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOpenrouter_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationOutlookCalendar_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSendGrid_integrationId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSendGrid_workspaceId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSmtp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationSmtp_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "botId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTelegram_botId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "openId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationTiktok_openId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_inboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "welcomeFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWebchat_welcomeFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationWhatsapp_phoneNumberId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "fallbackFlowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_fallbackFlowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "IntegrationZalo_inboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLink_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLink_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "linkId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MagicLinkStat_workspaceId_linkId_occurredAt_contactInboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFile_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFile_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MediaLibraryFolder_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_conversation_history_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_workspace_created_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_contactInboxId_sourceId_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "conversationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_conversationId_type_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": false, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"parentId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Message_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "inboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_inboxId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "createdAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_status_createdAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessageCleanup_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessageCleanup" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationWhatsappId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationMessengerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdOperation_integrationInstagramId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationWhatsappId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationMessengerId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationInstagramId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessagingAdsConnection_integrationInstagramId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMessengerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MessengerMessageTemplate_integrationMessengerId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_workspaceId_channel_sourceKey_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_contactInboxId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channel", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCapiEvent_channel_integrationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMetaCatalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "catalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "retailerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_integration_retailer_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationMetaCatalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "catalogId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_integration_product_key", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogItem_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" IN ('queued', 'running')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "MetaCatalogSyncRun_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Minigame_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Minigame_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_minigameId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigameContact_minigameId_contactId_key", + "entityType": "indexes", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "minigameId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigamePlay_minigameId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "MinigamePlay_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "livemode", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"userId\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_user_type_livemode_key", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "livemode", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"userId\" IS NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_platform_type_livemode_key", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "PlatformCredential_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "categoryId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_categoryId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "subcategoryId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Product_subcategoryId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductAddon_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductAddon" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductCategory_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "parentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductCategory_parentId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductVariant_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductVariant" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "productId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "ProductVariantOption_productId_idx", + "entityType": "indexes", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "submissionId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "questionIdSnapshot", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireAnswer_submissionId_questionIdSnapshot_key", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireAnswer_questionId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Questionnaire_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Questionnaire_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "orderNo", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireQuestion_questionnaireId_orderNo_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "customFieldId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireQuestion_customFieldId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_questionnaireId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "questionnaireId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_questionnaireId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "\"status\" = 'inProgress'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "QuestionnaireSubmission_workspaceId_contactId_active_key", + "entityType": "indexes", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "RefLinkStat_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "linkId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "occurredAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactInboxId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "RefLinkStat_workspaceId_linkId_occurredAt_contactInboxId_key", + "entityType": "indexes", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Reflink_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Sequence_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Sequence_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "idempotencyKey", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_idempotencyKey_key", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_pending_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "bucket", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" = 'pending'", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_pending_bucket_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_workspaceId_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "enrollmentId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_enrollmentId_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "stepId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "id", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_workspace_sequence_step_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "bucket", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "runAtMs", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_bucket_status_runAtMs_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "updatedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"status\" in ('completed', 'failed', 'canceled')", + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_terminal_updatedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceDispatch_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "sequenceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceStep_sequenceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "flowId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "SequenceStep_flowId_idx", + "entityType": "indexes", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "spreadsheetId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_workspaceId_spreadsheetId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "spreadsheetId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Spreadsheet_spreadsheetId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": "(\"deletedAt\" is null)", + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tag_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Tag_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tagId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_tag_integration_key", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "externalLabelId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_external_key", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_workspace_channel_idx", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "channelType", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "integrationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TagChannel_integration_idx", + "entityType": "indexes", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "shareToken", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Template_shareToken_key", + "entityType": "indexes", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "templateId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_templateId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "status", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstallation_workspaceId_status_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "installationId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstalledResource_installationId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "resourceKind", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "resourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TemplateInstalledResource_workspaceId_resourceKind_resourceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "name", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_name_key", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "active", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Trigger_workspaceId_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_source_id_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_triggerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_webhookId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_sourceId_triggerId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "type", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Condition_type_sourceId_webhookId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_triggerId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerContactHistory_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_triggerId_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerExecution_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_triggerId_date_key", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "triggerId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_triggerId_date_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "date", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "TriggerStat_workspaceId_date_idx", + "entityType": "indexes", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserDeviceToken_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "UserPersistentMenu_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "folderId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_folderId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "active", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Webhook_workspaceId_active_idx", + "entityType": "indexes", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "webhookId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_webhookId_contactId_key", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "workspaceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_workspaceId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "contactId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WebhookExecution_contactId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_phoneNumberId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "phoneNumberId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "payloadHash", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_phone_hash_uq", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "processedAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": "\"processedAt\" IS NOT NULL", + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappCoexistStaging_processedAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappCoexistStaging" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappFlow_integrationWhatsappId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "integrationWhatsappId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + }, + { + "value": "sourceId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": true, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappMessageTemplate_integrationWhatsappId_sourceId_key", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "userId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappSignupSession_userId_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "expiresAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "WhatsappSignupSession_expiresAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "tenantId", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Workspace_tenantId_idx", + "entityType": "indexes", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": true, + "columns": [ + { + "value": "scheduledDeletionAt", + "isExpression": false, + "asc": true, + "nullsFirst": false, + "opclass": null + } + ], + "isUnique": false, + "where": null, + "with": "", + "method": "btree", + "concurrently": false, + "name": "Workspace_scheduledDeletionAt_idx", + "entityType": "indexes", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["shardId"], + "schemaTo": "public", + "tableTo": "MessageShard", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ShardTimeRange_shardId_MessageShard_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ShardTimeRange" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_IENNsXLBb1k1_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_yeTDEtvJMs4H_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionEvent_1X1qUqZpm24x_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AdsConversionEvent_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_k99JXbMObQIn_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationFacebookAdsId"], + "schemaTo": "public", + "tableTo": "IntegrationFacebookAds", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_fBmu8W26Mw5R_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_3zzAptVRRuZD_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AdsConversionRule_HUibBtSUZbML_fkey", + "entityType": "fks", + "schema": "public", + "table": "AdsConversionRule" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIAgent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIAgent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIAssistant_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIAssistant" + }, + { + "nameExplicit": false, + "columns": ["sourceId"], + "schemaTo": "public", + "tableTo": "AIConversationSource", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_sourceId_AIConversationSource_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationEmbedding_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationSource_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIConversationSource_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIConversationSource" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIEmbedding_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": false, + "columns": ["aiFileId"], + "schemaTo": "public", + "tableTo": "AIFile", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIEmbedding_aiFileId_AIFile_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIEmbedding" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIFile_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFile" + }, + { + "nameExplicit": false, + "columns": ["triggerFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AIFunction_triggerFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFunction" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIFunction_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIFunction" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AIMCPServer_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AIMCPServer" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITrigger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITrigger" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AITrigger_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITrigger" + }, + { + "nameExplicit": false, + "columns": ["aiTriggerId"], + "schemaTo": "public", + "tableTo": "AITrigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITriggerToIntegrationOpenai_aiTriggerId_AITrigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationOpenaiId"], + "schemaTo": "public", + "tableTo": "IntegrationOpenai", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AITriggerToIntegrationOpenai_rSgeY7c25Tng_fkey", + "entityType": "fks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsBotMessageEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsBroadcastEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsContactEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsConversationEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsFlowNodeEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsMessageEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "AnalyticsSequenceEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "nameExplicit": false, + "columns": ["topicId"], + "schemaTo": "public", + "tableTo": "EmailTopic", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AnalyticsEmailTopic_topicId_EmailTopic_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AnalyticsEmailTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AnalyticsEmailTopic_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AnalyticsEmailTopic" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Appointment_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Appointment_calendarId_AppointmentCalendar_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Appointment_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Appointment_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Appointment" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["confirmationFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_confirmationFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["cancellationFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_cancellationFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["externalConnectionId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentCalendar_externalConnectionId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendar" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarAvailability_QfahoIQAX592_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarAvailability" + }, + { + "nameExplicit": false, + "columns": ["calendarId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendar", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarReminder_5O4INfYC3dY3_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentCalendarReminder_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentCalendarReminder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["appointmentId"], + "schemaTo": "public", + "tableTo": "Appointment", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_appointmentId_Appointment_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["reminderConfigId"], + "schemaTo": "public", + "tableTo": "AppointmentCalendarReminder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AppointmentReminderDispatch_a526jJM55OD7_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AppointmentReminderDispatch_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AppointmentReminderDispatch" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Account_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Account_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Account" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Invitation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": false, + "columns": ["invitedBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Invitation_invitedBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Invitation" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Session_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Session" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "User_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "User" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomatedResponse_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AutomatedResponse_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AutomatedResponse_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomatedResponse" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomationThrottle_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AutomationThrottle_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "BotField_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "BotField_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "BotField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Broadcast_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Broadcast_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Broadcast_integrationWhatsappId_IntegrationWhatsapp_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Broadcast_integrationMessengerId_IntegrationMessenger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Broadcast" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Contact_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Contact" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactCustomField_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactCustomField_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactCustomField" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactInbox_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactInbox_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactInbox" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactNote_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": false, + "columns": ["createdById"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactNote_createdById_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactNote" + }, + { + "nameExplicit": false, + "columns": ["broadcastId"], + "schemaTo": "public", + "tableTo": "Broadcast", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_broadcastId_Broadcast_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnBroadcast_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSequence_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSmartDelay_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["appointmentId"], + "schemaTo": "public", + "tableTo": "Appointment", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "ContactOnSmartDelay_appointmentId_Appointment_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactOnSmartDelay_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactOnSmartDelay" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTag_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTag" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTag_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTag" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["tagChannelId"], + "schemaTo": "public", + "tableTo": "TagChannel", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_tagChannelId_TagChannel_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ContactToTagChannel_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "nameExplicit": false, + "columns": ["assignedUserId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Conversation_assignedUserId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["assignedInboxTeamId"], + "schemaTo": "public", + "tableTo": "InboxTeam", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Conversation_assignedInboxTeamId_InboxTeam_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Conversation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Conversation_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Conversation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ConversationParticipant_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ConversationParticipant" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Coupon_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["topicId"], + "schemaTo": "public", + "tableTo": "CouponTopic", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Coupon_topicId_CouponTopic_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["issuedContactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Coupon_issuedContactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Coupon" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CouponTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": false, + "columns": ["createdById"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "CouponTopic_createdById_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CouponTopic" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "CustomField_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CustomField_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomField" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "DynamicImage_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "DynamicImage_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "DynamicImage" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "EmailTopic_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "EmailTopic_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "EmailTopic" + }, + { + "nameExplicit": true, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "AuditLog_workspaceId_fkey", + "entityType": "fks", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": true, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "AuditLog_userId_fkey", + "entityType": "fks", + "schema": "public", + "table": "AuditLog" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "CustomDomain_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "CustomDomain" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Tenant_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tenant" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TenantHelpItem_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TenantHelpItem" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "UserQuota_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserQuota" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "WorkspaceUsage_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceUsage" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ErrorLog_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "ErrorLog_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ErrorLog" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ExternalWebhook_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ExternalWebhook" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FacebookLeadAdsAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FacebookLeadAdsAutomation_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsAutomation" + }, + { + "nameExplicit": false, + "columns": ["automationId"], + "schemaTo": "public", + "tableTo": "FacebookLeadAdsAutomation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FacebookLeadAdsLead_n8swD949nr3L_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FacebookLeadAdsLead_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FacebookLeadAdsLead" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FBCommentAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "FBCommentAutomation_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomation" + }, + { + "nameExplicit": false, + "columns": ["automationId"], + "schemaTo": "public", + "tableTo": "FBCommentAutomation", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_Q6yXIfuQcsD0_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "NO ACTION", + "onDelete": "CASCADE", + "name": "FBCommentAutomationReply_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FBCommentAutomationReply" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "File_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "File_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "File" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Flow_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Flow" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Flow_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Flow" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowNodeStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowNodeStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["flowVersionId"], + "schemaTo": "public", + "tableTo": "FlowVersion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_flowVersionId_FlowVersion_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowRun_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowRun" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowVersion_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowVersion" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "FlowVersion_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "FlowVersion" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Folder_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Folder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IgStoryAutomation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IgStoryAutomation_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IgStoryAutomation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Import_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Import_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Import_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["fileId"], + "schemaTo": "public", + "tableTo": "File", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Import_fileId_File_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Import" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Inbox_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Inbox" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxContactStat_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxContactStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeam_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeam" + }, + { + "nameExplicit": false, + "columns": ["inboxTeamId"], + "schemaTo": "public", + "tableTo": "InboxTeam", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeamMember_inboxTeamId_InboxTeam_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "InboxTeamMember_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "InboxTeamMember" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationActiveCampaign_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationActiveCampaign_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationActiveCampaign" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationApi_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationApi_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationApi" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Integration_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Integration" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationClaude_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationClaude_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationClaude" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDeepseek_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDeepseek_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDeepseek" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDrip_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationDrip_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationDrip" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationFacebookAds_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationFacebookAds_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationFacebookAds" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGemini_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGemini_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGemini" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGetResponse_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGetResponse_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGetResponse" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleCalendar_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleCalendar" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleSheet_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationGoogleSheet_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationGoogleSheet" + }, + { + "nameExplicit": true, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationInstagram_workspaceId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationInstagram_inboxId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": true, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationInstagram_welcomeFlowId_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationInstagram" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationKlaviyo_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationKlaviyo_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationKlaviyo" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailchimp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailchimp_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailchimp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailerLite_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMailerLite_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMailerLite" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMessenger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMessenger_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationMessenger_welcomeFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMessenger" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMetaCatalog_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMetaCatalog_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMetaCatalog" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMoosend_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationMoosend_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationMoosend" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenai_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenai_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["aiAssistantId"], + "schemaTo": "public", + "tableTo": "AIAssistant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationOpenai_aiAssistantId_AIAssistant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["aiAgentId"], + "schemaTo": "public", + "tableTo": "AIAgent", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationOpenai_aiAgentId_AIAgent_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenai" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenaiCompatible_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenaiCompatible_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenaiCompatible" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenrouter_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOpenrouter_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOpenrouter" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOutlookCalendar_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationOutlookCalendar_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationOutlookCalendar" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSendGrid_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": false, + "columns": ["integrationId"], + "schemaTo": "public", + "tableTo": "Integration", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSendGrid_integrationId_Integration_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSendGrid" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSmtp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationSmtp_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationSmtp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTelegram_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTelegram_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTelegram" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTiktok_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationTiktok_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationTiktok" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWebchat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWebchat_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["welcomeFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationWebchat_welcomeFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWebchat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWhatsapp_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationWhatsapp_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationZalo_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["inboxId"], + "schemaTo": "public", + "tableTo": "Inbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "IntegrationZalo_inboxId_Inbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["fallbackFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "IntegrationZalo_fallbackFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "IntegrationZalo" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLink_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLinkStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": false, + "columns": ["linkId"], + "schemaTo": "public", + "tableTo": "MagicLink", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MagicLinkStat_linkId_MagicLink_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MagicLinkStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MediaLibraryFile_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "MediaLibraryFolder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MediaLibraryFile_folderId_MediaLibraryFolder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFile" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MediaLibraryFolder_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MediaLibraryFolder" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_D2X0VlACjh0B_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_DlCmuyYqclNt_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdOperation_LwL2ykeZegup_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["createdBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MessagingAdOperation_createdBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_Q2FrBLiP3QqD_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_tLZC78O5pMBb_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationInstagramId"], + "schemaTo": "public", + "tableTo": "IntegrationInstagram", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessagingAdsConnection_4ubezEjd9jQX_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "nameExplicit": false, + "columns": ["integrationMessengerId"], + "schemaTo": "public", + "tableTo": "IntegrationMessenger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MessengerMessageTemplate_x0Vv1d8cvLYN_fkey", + "entityType": "fks", + "schema": "public", + "table": "MessengerMessageTemplate" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCapiEvent_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCapiEvent_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "nameExplicit": false, + "columns": ["integrationMetaCatalogId"], + "schemaTo": "public", + "tableTo": "IntegrationMetaCatalog", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogItem_wJXyKUssR08y_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogItem_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogItem" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogSyncRun_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["integrationMetaCatalogId"], + "schemaTo": "public", + "tableTo": "IntegrationMetaCatalog", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MetaCatalogSyncRun_8PnmCJ0uISUd_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["categoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MetaCatalogSyncRun_categoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MetaCatalogSyncRun" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Minigame_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Minigame" + }, + { + "nameExplicit": false, + "columns": ["minigameId"], + "schemaTo": "public", + "tableTo": "Minigame", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigameContact_minigameId_Minigame_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigameContact_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["referrerContactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "MinigameContact_referrerContactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigameContact" + }, + { + "nameExplicit": false, + "columns": ["minigameId"], + "schemaTo": "public", + "tableTo": "Minigame", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigamePlay_minigameId_Minigame_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "MinigamePlay_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "MinigamePlay" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "PlatformCredential_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "PlatformCredential" + }, + { + "nameExplicit": false, + "columns": ["categoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Product_categoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["subcategoryId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Product_subcategoryId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Product_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Product" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductAddon_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductAddon" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductCategory_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": false, + "columns": ["parentId"], + "schemaTo": "public", + "tableTo": "ProductCategory", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductCategory_parentId_ProductCategory_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductVariant_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductVariant" + }, + { + "nameExplicit": false, + "columns": ["productId"], + "schemaTo": "public", + "tableTo": "Product", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "ProductVariantOption_productId_Product_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "ProductVariantOption" + }, + { + "nameExplicit": false, + "columns": ["submissionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireSubmission", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireAnswer_l8clOEM7NsPl_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": false, + "columns": ["questionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireQuestion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireAnswer_questionId_QuestionnaireQuestion_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireAnswer" + }, + { + "nameExplicit": false, + "columns": ["triggerFlowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Questionnaire_triggerFlowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Questionnaire_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Questionnaire" + }, + { + "nameExplicit": false, + "columns": ["questionnaireId"], + "schemaTo": "public", + "tableTo": "Questionnaire", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireQuestion_questionnaireId_Questionnaire_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireQuestion_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["questionnaireId"], + "schemaTo": "public", + "tableTo": "Questionnaire", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_questionnaireId_Questionnaire_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "QuestionnaireSubmission_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["conversationId"], + "schemaTo": "public", + "tableTo": "Conversation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireSubmission_conversationId_Conversation_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["currentQuestionId"], + "schemaTo": "public", + "tableTo": "QuestionnaireQuestion", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "QuestionnaireSubmission_mha0bYFxcV7A_fkey", + "entityType": "fks", + "schema": "public", + "table": "QuestionnaireSubmission" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "RefLinkStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": false, + "columns": ["linkId"], + "schemaTo": "public", + "tableTo": "Reflink", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "RefLinkStat_linkId_Reflink_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "RefLinkStat" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Reflink_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Reflink_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["customFieldId"], + "schemaTo": "public", + "tableTo": "CustomField", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Reflink_customFieldId_CustomField_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Reflink" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SavedReply_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SavedReply" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Sequence_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Sequence_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Sequence" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["contactInboxId"], + "schemaTo": "public", + "tableTo": "ContactInbox", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_contactInboxId_ContactInbox_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["stepId"], + "schemaTo": "public", + "tableTo": "SequenceStep", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_stepId_SequenceStep_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": true, + "columns": ["enrollmentId", "workspaceId"], + "schemaTo": "public", + "tableTo": "ContactOnSequence", + "columnsTo": ["id", "workspaceId"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceDispatch_enrollment_workspace_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "nameExplicit": false, + "columns": ["flowId"], + "schemaTo": "public", + "tableTo": "Flow", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "SequenceStep_flowId_Flow_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": false, + "columns": ["sequenceId"], + "schemaTo": "public", + "tableTo": "Sequence", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "SequenceStep_sequenceId_Sequence_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "SequenceStep" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Spreadsheet_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Spreadsheet" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Tag_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Tag_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Tag" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TagChannel_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": false, + "columns": ["tagId"], + "schemaTo": "public", + "tableTo": "Tag", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TagChannel_tagId_Tag_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TagChannel" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Template_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Template_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["createdBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Template_createdBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Template" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstallation_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["templateId"], + "schemaTo": "public", + "tableTo": "Template", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_templateId_Template_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installFolderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_installFolderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installedBy"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "TemplateInstallation_installedBy_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstallation" + }, + { + "nameExplicit": false, + "columns": ["installationId"], + "schemaTo": "public", + "tableTo": "TemplateInstallation", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstalledResource_a0BqwWeO96EB_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TemplateInstalledResource_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TemplateInstalledResource" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Trigger_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Trigger_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Trigger" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Condition_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": false, + "columns": ["webhookId"], + "schemaTo": "public", + "tableTo": "Webhook", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Condition_webhookId_Webhook_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Condition" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerContactHistory_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerExecution_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerExecution" + }, + { + "nameExplicit": false, + "columns": ["triggerId"], + "schemaTo": "public", + "tableTo": "Trigger", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerStat_triggerId_Trigger_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "TriggerStat_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "TriggerStat" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserDeviceToken_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserDeviceToken_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "UserPersistentMenu_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "UserPersistentMenu" + }, + { + "nameExplicit": false, + "columns": ["folderId"], + "schemaTo": "public", + "tableTo": "Folder", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "SET NULL", + "name": "Webhook_folderId_Folder_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "Webhook_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Webhook" + }, + { + "nameExplicit": false, + "columns": ["webhookId"], + "schemaTo": "public", + "tableTo": "Webhook", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_webhookId_Webhook_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["contactId"], + "schemaTo": "public", + "tableTo": "Contact", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_contactId_Contact_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WebhookExecution_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WebhookExecution" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappFlow_integrationWhatsappId_IntegrationWhatsapp_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappFlow" + }, + { + "nameExplicit": false, + "columns": ["integrationWhatsappId"], + "schemaTo": "public", + "tableTo": "IntegrationWhatsapp", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappMessageTemplate_p6pSomUTTJCm_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappMessageTemplate" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WhatsappSignupSession_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WhatsappSignupSession" + }, + { + "nameExplicit": false, + "columns": ["ownerId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Workspace_ownerId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["tenantId"], + "schemaTo": "public", + "tableTo": "Tenant", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "RESTRICT", + "name": "Workspace_tenantId_Tenant_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "Workspace" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMac_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "schemaTo": "public", + "tableTo": "Workspace", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMember_workspaceId_Workspace_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "schemaTo": "public", + "tableTo": "User", + "columnsTo": ["id"], + "onUpdate": "CASCADE", + "onDelete": "CASCADE", + "name": "WorkspaceMember_userId_User_id_fkey", + "entityType": "fks", + "schema": "public", + "table": "WorkspaceMember" + }, + { + "columns": ["aiTriggerId", "integrationOpenaiId"], + "nameExplicit": false, + "name": "AITriggerToIntegrationOpenai_pkey", + "entityType": "pks", + "schema": "public", + "table": "AITriggerToIntegrationOpenai" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsBotMessageEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsBotMessageEvent" + }, + { + "columns": [ + "broadcastId", + "contactInboxId", + "batchId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsBroadcastEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsBroadcastEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsContactEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsContactEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsConversationEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsConversationEvent" + }, + { + "columns": [ + "flowId", + "analyticsId", + "nodeId", + "buttonId", + "contactInboxId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsFlowNodeEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsFlowNodeEvent" + }, + { + "columns": ["occurredAt", "eventId"], + "nameExplicit": false, + "name": "AnalyticsMessageEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsMessageEvent" + }, + { + "columns": [ + "sequenceId", + "stepId", + "contactInboxId", + "eventType", + "occurredAt" + ], + "nameExplicit": false, + "name": "AnalyticsSequenceEvent_pkey", + "entityType": "pks", + "schema": "public", + "table": "AnalyticsSequenceEvent" + }, + { + "columns": ["id", "createdAt"], + "nameExplicit": false, + "name": "Attachment_pkey", + "entityType": "pks", + "schema": "public", + "table": "Attachment" + }, + { + "columns": ["workspaceId", "contactInboxId", "throttleType", "subjectId"], + "nameExplicit": true, + "name": "AutomationThrottle_pkey", + "entityType": "pks", + "schema": "public", + "table": "AutomationThrottle" + }, + { + "columns": ["workspaceId", "hourBucket", "contactInboxId"], + "nameExplicit": false, + "name": "ContactActiveHourly_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactActiveHourly" + }, + { + "columns": ["workspaceId", "periodStart", "contactInboxId"], + "nameExplicit": false, + "name": "ContactActiveMonthly_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactActiveMonthly" + }, + { + "columns": ["broadcastId", "contactId"], + "nameExplicit": true, + "name": "ContactsOnBroadcast_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactOnBroadcast" + }, + { + "columns": ["id", "workspaceId"], + "nameExplicit": true, + "name": "ContactOnSequence_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactOnSequence" + }, + { + "columns": ["contactId", "tagId"], + "nameExplicit": false, + "name": "ContactToTag_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactToTag" + }, + { + "columns": ["tagChannelId", "contactInboxId"], + "nameExplicit": false, + "name": "ContactToTagChannel_pkey", + "entityType": "pks", + "schema": "public", + "table": "ContactToTagChannel" + }, + { + "columns": ["id", "createdAt"], + "nameExplicit": false, + "name": "Message_pkey", + "entityType": "pks", + "schema": "public", + "table": "Message" + }, + { + "columns": ["id", "workspaceId"], + "nameExplicit": true, + "name": "SequenceDispatch_pkey", + "entityType": "pks", + "schema": "public", + "table": "SequenceDispatch" + }, + { + "columns": ["id", "contactId"], + "nameExplicit": true, + "name": "TriggerContactHistory_pkey", + "entityType": "pks", + "schema": "public", + "table": "TriggerContactHistory" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessageShard_pkey", + "schema": "public", + "table": "MessageShard", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ShardTimeRange_pkey", + "schema": "public", + "table": "ShardTimeRange", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AdsConversionEvent_pkey", + "schema": "public", + "table": "AdsConversionEvent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AdsConversionRule_pkey", + "schema": "public", + "table": "AdsConversionRule", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIAgent_pkey", + "schema": "public", + "table": "AIAgent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIAssistant_pkey", + "schema": "public", + "table": "AIAssistant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIConversationEmbedding_pkey", + "schema": "public", + "table": "AIConversationEmbedding", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIConversationSource_pkey", + "schema": "public", + "table": "AIConversationSource", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIEmbedding_pkey", + "schema": "public", + "table": "AIEmbedding", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIFile_pkey", + "schema": "public", + "table": "AIFile", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIFunction_pkey", + "schema": "public", + "table": "AIFunction", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AIMCPServer_pkey", + "schema": "public", + "table": "AIMCPServer", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AITrigger_pkey", + "schema": "public", + "table": "AITrigger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AnalyticsEmailTopic_pkey", + "schema": "public", + "table": "AnalyticsEmailTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Appointment_pkey", + "schema": "public", + "table": "Appointment", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendar_pkey", + "schema": "public", + "table": "AppointmentCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendarAvailability_pkey", + "schema": "public", + "table": "AppointmentCalendarAvailability", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentCalendarReminder_pkey", + "schema": "public", + "table": "AppointmentCalendarReminder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AppointmentReminderDispatch_pkey", + "schema": "public", + "table": "AppointmentReminderDispatch", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Account_pkey", + "schema": "public", + "table": "Account", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Invitation_pkey", + "schema": "public", + "table": "Invitation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Jwk_pkey", + "schema": "public", + "table": "Jwk", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Session_pkey", + "schema": "public", + "table": "Session", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "User_pkey", + "schema": "public", + "table": "User", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Verification_pkey", + "schema": "public", + "table": "Verification", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AutomatedResponse_pkey", + "schema": "public", + "table": "AutomatedResponse", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "BotField_pkey", + "schema": "public", + "table": "BotField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Broadcast_pkey", + "schema": "public", + "table": "Broadcast", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CoexistSyncRun_pkey", + "schema": "public", + "table": "CoexistSyncRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Contact_pkey", + "schema": "public", + "table": "Contact", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactCustomField_pkey", + "schema": "public", + "table": "ContactCustomField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactInbox_pkey", + "schema": "public", + "table": "ContactInbox", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactNote_pkey", + "schema": "public", + "table": "ContactNote", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ContactOnSmartDelay_pkey", + "schema": "public", + "table": "ContactOnSmartDelay", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Conversation_pkey", + "schema": "public", + "table": "Conversation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ConversationParticipant_pkey", + "schema": "public", + "table": "ConversationParticipant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Coupon_pkey", + "schema": "public", + "table": "Coupon", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CouponTopic_pkey", + "schema": "public", + "table": "CouponTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CustomField_pkey", + "schema": "public", + "table": "CustomField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "DynamicImage_pkey", + "schema": "public", + "table": "DynamicImage", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "EmailTopic_pkey", + "schema": "public", + "table": "EmailTopic", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "AuditLog_pkey", + "schema": "public", + "table": "AuditLog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "CustomDomain_pkey", + "schema": "public", + "table": "CustomDomain", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Tenant_pkey", + "schema": "public", + "table": "Tenant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TenantHelpItem_pkey", + "schema": "public", + "table": "TenantHelpItem", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserQuota_pkey", + "schema": "public", + "table": "UserQuota", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceUsage_pkey", + "schema": "public", + "table": "WorkspaceUsage", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ErrorLog_pkey", + "schema": "public", + "table": "ErrorLog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ExternalWebhook_pkey", + "schema": "public", + "table": "ExternalWebhook", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FacebookLeadAdsAutomation_pkey", + "schema": "public", + "table": "FacebookLeadAdsAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FacebookLeadAdsLead_pkey", + "schema": "public", + "table": "FacebookLeadAdsLead", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FBCommentAutomation_pkey", + "schema": "public", + "table": "FBCommentAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FBCommentAutomationReply_pkey", + "schema": "public", + "table": "FBCommentAutomationReply", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "File_pkey", + "schema": "public", + "table": "File", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Flow_pkey", + "schema": "public", + "table": "Flow", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowAnalyticsSession_pkey", + "schema": "public", + "table": "FlowAnalyticsSession", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowNodeStat_pkey", + "schema": "public", + "table": "FlowNodeStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowRun_pkey", + "schema": "public", + "table": "FlowRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "FlowVersion_pkey", + "schema": "public", + "table": "FlowVersion", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Folder_pkey", + "schema": "public", + "table": "Folder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IgStoryAutomation_pkey", + "schema": "public", + "table": "IgStoryAutomation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Import_pkey", + "schema": "public", + "table": "Import", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Inbox_pkey", + "schema": "public", + "table": "Inbox", + "entityType": "pks" + }, + { + "columns": ["inboxId"], + "nameExplicit": false, + "name": "InboxContactStat_pkey", + "schema": "public", + "table": "InboxContactStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "InboxTeam_pkey", + "schema": "public", + "table": "InboxTeam", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "InboxTeamMember_pkey", + "schema": "public", + "table": "InboxTeamMember", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationActiveCampaign_pkey", + "schema": "public", + "table": "IntegrationActiveCampaign", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationApi_pkey", + "schema": "public", + "table": "IntegrationApi", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Integration_pkey", + "schema": "public", + "table": "Integration", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationClaude_pkey", + "schema": "public", + "table": "IntegrationClaude", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationDeepseek_pkey", + "schema": "public", + "table": "IntegrationDeepseek", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationDrip_pkey", + "schema": "public", + "table": "IntegrationDrip", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationFacebookAds_pkey", + "schema": "public", + "table": "IntegrationFacebookAds", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGemini_pkey", + "schema": "public", + "table": "IntegrationGemini", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGetResponse_pkey", + "schema": "public", + "table": "IntegrationGetResponse", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGoogleCalendar_pkey", + "schema": "public", + "table": "IntegrationGoogleCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationGoogleSheet_pkey", + "schema": "public", + "table": "IntegrationGoogleSheet", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationInstagram_pkey", + "schema": "public", + "table": "IntegrationInstagram", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationKlaviyo_pkey", + "schema": "public", + "table": "IntegrationKlaviyo", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMailchimp_pkey", + "schema": "public", + "table": "IntegrationMailchimp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMailerLite_pkey", + "schema": "public", + "table": "IntegrationMailerLite", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMessenger_pkey", + "schema": "public", + "table": "IntegrationMessenger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMetaCatalog_pkey", + "schema": "public", + "table": "IntegrationMetaCatalog", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationMoosend_pkey", + "schema": "public", + "table": "IntegrationMoosend", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenai_pkey", + "schema": "public", + "table": "IntegrationOpenai", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenaiCompatible_pkey", + "schema": "public", + "table": "IntegrationOpenaiCompatible", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOpenrouter_pkey", + "schema": "public", + "table": "IntegrationOpenrouter", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationOutlookCalendar_pkey", + "schema": "public", + "table": "IntegrationOutlookCalendar", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationSendGrid_pkey", + "schema": "public", + "table": "IntegrationSendGrid", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationSmtp_pkey", + "schema": "public", + "table": "IntegrationSmtp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationTelegram_pkey", + "schema": "public", + "table": "IntegrationTelegram", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationTiktok_pkey", + "schema": "public", + "table": "IntegrationTiktok", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationWebchat_pkey", + "schema": "public", + "table": "IntegrationWebchat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationWhatsapp_pkey", + "schema": "public", + "table": "IntegrationWhatsapp", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "IntegrationZalo_pkey", + "schema": "public", + "table": "IntegrationZalo", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MagicLink_pkey", + "schema": "public", + "table": "MagicLink", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MediaLibraryFile_pkey", + "schema": "public", + "table": "MediaLibraryFile", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MediaLibraryFolder_pkey", + "schema": "public", + "table": "MediaLibraryFolder", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessageCleanup_pkey", + "schema": "public", + "table": "MessageCleanup", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessagingAdOperation_pkey", + "schema": "public", + "table": "MessagingAdOperation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessagingAdsConnection_pkey", + "schema": "public", + "table": "MessagingAdsConnection", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MessengerMessageTemplate_pkey", + "schema": "public", + "table": "MessengerMessageTemplate", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCapiEvent_pkey", + "schema": "public", + "table": "MetaCapiEvent", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCatalogItem_pkey", + "schema": "public", + "table": "MetaCatalogItem", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MetaCatalogSyncRun_pkey", + "schema": "public", + "table": "MetaCatalogSyncRun", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Minigame_pkey", + "schema": "public", + "table": "Minigame", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MinigameContact_pkey", + "schema": "public", + "table": "MinigameContact", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "MinigamePlay_pkey", + "schema": "public", + "table": "MinigamePlay", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "PlatformCredential_pkey", + "schema": "public", + "table": "PlatformCredential", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Product_pkey", + "schema": "public", + "table": "Product", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductAddon_pkey", + "schema": "public", + "table": "ProductAddon", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductCategory_pkey", + "schema": "public", + "table": "ProductCategory", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductVariant_pkey", + "schema": "public", + "table": "ProductVariant", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "ProductVariantOption_pkey", + "schema": "public", + "table": "ProductVariantOption", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireAnswer_pkey", + "schema": "public", + "table": "QuestionnaireAnswer", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Questionnaire_pkey", + "schema": "public", + "table": "Questionnaire", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireQuestion_pkey", + "schema": "public", + "table": "QuestionnaireQuestion", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "QuestionnaireSubmission_pkey", + "schema": "public", + "table": "QuestionnaireSubmission", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Reflink_pkey", + "schema": "public", + "table": "Reflink", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SavedReply_pkey", + "schema": "public", + "table": "SavedReply", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Sequence_pkey", + "schema": "public", + "table": "Sequence", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SequenceStep_pkey", + "schema": "public", + "table": "SequenceStep", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Spreadsheet_pkey", + "schema": "public", + "table": "Spreadsheet", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "SystemField_pkey", + "schema": "public", + "table": "SystemField", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Tag_pkey", + "schema": "public", + "table": "Tag", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TagChannel_pkey", + "schema": "public", + "table": "TagChannel", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Template_pkey", + "schema": "public", + "table": "Template", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TemplateInstallation_pkey", + "schema": "public", + "table": "TemplateInstallation", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TemplateInstalledResource_pkey", + "schema": "public", + "table": "TemplateInstalledResource", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Trigger_pkey", + "schema": "public", + "table": "Trigger", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Condition_pkey", + "schema": "public", + "table": "Condition", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TriggerExecution_pkey", + "schema": "public", + "table": "TriggerExecution", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "TriggerStat_pkey", + "schema": "public", + "table": "TriggerStat", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserDeviceToken_pkey", + "schema": "public", + "table": "UserDeviceToken", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "UserPersistentMenu_pkey", + "schema": "public", + "table": "UserPersistentMenu", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Webhook_pkey", + "schema": "public", + "table": "Webhook", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WebhookExecution_pkey", + "schema": "public", + "table": "WebhookExecution", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappCoexistStaging_pkey", + "schema": "public", + "table": "WhatsappCoexistStaging", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappFlow_pkey", + "schema": "public", + "table": "WhatsappFlow", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappMessageTemplate_pkey", + "schema": "public", + "table": "WhatsappMessageTemplate", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WhatsappSignupSession_pkey", + "schema": "public", + "table": "WhatsappSignupSession", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "Workspace_pkey", + "schema": "public", + "table": "Workspace", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceMac_pkey", + "schema": "public", + "table": "WorkspaceMac", + "entityType": "pks" + }, + { + "columns": ["id"], + "nameExplicit": false, + "name": "WorkspaceMember_pkey", + "schema": "public", + "table": "WorkspaceMember", + "entityType": "pks" + }, + { + "nameExplicit": true, + "columns": ["contactInboxId", "sourceId", "createdAt"], + "nullsNotDistinct": false, + "name": "Message_source_dedup_idx", + "entityType": "uniques", + "schema": "public", + "table": "Message" + }, + { + "nameExplicit": true, + "columns": ["workspaceId", "parentId", "name"], + "nullsNotDistinct": true, + "name": "ProductCategory_workspaceId_parent_name_key", + "entityType": "uniques", + "schema": "public", + "table": "ProductCategory" + }, + { + "nameExplicit": true, + "columns": ["token"], + "nullsNotDistinct": false, + "name": "UserDeviceToken_token_key", + "entityType": "uniques", + "schema": "public", + "table": "UserDeviceToken" + }, + { + "nameExplicit": true, + "columns": ["workspaceId", "periodStart", "periodEnd"], + "nullsNotDistinct": false, + "name": "WorkspaceMac_workspaceId_periodStart_periodEnd_unique", + "entityType": "uniques", + "schema": "public", + "table": "WorkspaceMac" + }, + { + "nameExplicit": false, + "columns": ["userId"], + "nullsNotDistinct": false, + "name": "UserQuota_userId_key", + "schema": "public", + "table": "UserQuota", + "entityType": "uniques" + }, + { + "nameExplicit": false, + "columns": ["workspaceId"], + "nullsNotDistinct": false, + "name": "WorkspaceUsage_workspaceId_key", + "schema": "public", + "table": "WorkspaceUsage", + "entityType": "uniques" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"ctwaClid\" IS NOT NULL AND \"wabaId\" IS NOT NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL)", + "name": "AdsConversionEvent_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "AdsConversionEvent" + }, + { + "value": "(\"registrationStatus\" <> 'failed' OR \"registrationError\" IS NOT NULL)\n AND (\"registrationStatus\" <> 'registered' OR \"registrationError\" IS NULL)", + "name": "IntegrationWhatsapp_registrationStatus_error_consistent", + "entityType": "checks", + "schema": "public", + "table": "IntegrationWhatsapp" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"integrationMessengerId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationMessengerId\" IS NULL)", + "name": "MessagingAdOperation_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "MessagingAdOperation" + }, + { + "value": "(\"channel\" = 'whatsapp' AND \"integrationWhatsappId\" IS NOT NULL AND \"integrationMessengerId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'messenger' AND \"integrationMessengerId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationInstagramId\" IS NULL) OR (\"channel\" = 'instagram' AND \"integrationInstagramId\" IS NOT NULL AND \"integrationWhatsappId\" IS NULL AND \"integrationMessengerId\" IS NULL)", + "name": "MessagingAdsConnection_channel_integration_check", + "entityType": "checks", + "schema": "public", + "table": "MessagingAdsConnection" + }, + { + "value": "\"channel\" IN ('messenger', 'instagram', 'whatsapp')", + "name": "MetaCapiEvent_channel_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "\"actionSource\" IN ('business_messaging', 'email', 'phone_call', 'chat', 'physical_store', 'system_generated', 'other')", + "name": "MetaCapiEvent_actionSource_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "\"contentType\" IN ('product', 'product_group')", + "name": "MetaCapiEvent_contentType_check", + "entityType": "checks", + "schema": "public", + "table": "MetaCapiEvent" + }, + { + "value": "(\"customFieldId\" IS NULL) OR (\"systemFieldKey\" IS NULL)", + "name": "QuestionnaireQuestion_customFieldId_systemFieldKey_exclusive", + "entityType": "checks", + "schema": "public", + "table": "QuestionnaireQuestion" + }, + { + "value": "cardinality(\"candidatePhoneNumberIds\") > 0", + "name": "WhatsappSignupSession_candidates_not_empty", + "entityType": "checks", + "schema": "public", + "table": "WhatsappSignupSession" + } + ], + "renames": [] +} diff --git a/packages/database/src/queries/contact-filter/ctwa-retarget.ts b/packages/database/src/queries/contact-filter/ctwa-retarget.ts index ec863531b6..d3004cf161 100644 --- a/packages/database/src/queries/contact-filter/ctwa-retarget.ts +++ b/packages/database/src/queries/contact-filter/ctwa-retarget.ts @@ -340,8 +340,7 @@ export function adReferralPredicate(): SQL { * Ads Analytics "Retarget → Send WhatsApp broadcast" deep link * (`buildWhatsappRetargetHref`) hands this function the SAME `from`/`to` * date keys as the dashboard's own `parseAnalyticsDateRange`, which now - * anchors to the VIEWER's timezone (see - * `docs/plans/2026-08-27-ads-timezone-migration.md`). This function was not + * anchors to the VIEWER's timezone. This function was not * threaded the same way: `ctwaRetargetDateRange` sits behind the generic * contact-filter condition dispatcher (`buildWhereFromCondition` in * `queries/contact-filter/index.ts`), shared by every filter type across diff --git a/packages/database/src/repositories/automation-throttle/repository.ts b/packages/database/src/repositories/automation-throttle/repository.ts index 0d5eac76fa..0649164a14 100644 --- a/packages/database/src/repositories/automation-throttle/repository.ts +++ b/packages/database/src/repositories/automation-throttle/repository.ts @@ -2,7 +2,7 @@ import { and, db, eq, sql } from "../../client" import type { AutomationThrottleType } from "../../partials" import { automationThrottleModel } from "../../schema" -/** Retention window for `purgeStaleAutomationThrottles` — see `docs/plans/default-reply-throttle-hybrid.md`. */ +/** Retention window for `purgeStaleAutomationThrottles`. */ const STALE_RETENTION_HOURS = 48 type ThrottleSubject = { diff --git a/packages/database/src/repositories/contact-inbox/repository.ts b/packages/database/src/repositories/contact-inbox/repository.ts index 400af291f1..6280e9ad99 100644 --- a/packages/database/src/repositories/contact-inbox/repository.ts +++ b/packages/database/src/repositories/contact-inbox/repository.ts @@ -3,7 +3,6 @@ import { and, type DatabaseClient, db, - desc, eq, inArray, type SQL, @@ -72,13 +71,18 @@ type AdEligibleInboxChannelConfig = { * reference) so a mocked `@chatbotx.io/database/schema` missing one of the * three tables in tests doesn't fail to import this module. */ +const ctwaReferralCondition = (): SQL => + sql`${contactInboxModel.referral}->>'ctwaClid' IS NOT NULL` + +/** Most recent first; rows that never had a message sort last. */ +const mostRecentMessageFirst = (): SQL => + sql`${contactInboxModel.lastMessageAt} DESC NULLS LAST` + const adEligibleInboxChannelConfigs = { whatsapp: { model: () => integrationWhatsappModel, channel: "whatsapp", - referralConditions: () => [ - sql`${contactInboxModel.referral}->>'ctwaClid' IS NOT NULL`, - ], + referralConditions: () => [ctwaReferralCondition()], }, messenger: { model: () => integrationMessengerModel, @@ -173,11 +177,11 @@ export const contactInboxRepository = { * Workspace-scoped "most recently active inbox" for a contact — the * fallback `resolveActionContactInbox` uses when no producer threaded a * `contactInboxId` (schema-precludes-attribution events like - * `dateTimeBasedTrigger`, or a stale/foreign threaded id). Mirrors the - * ordering of the `db.query.contactInboxModel.findFirst({ orderBy: - * { lastMessageAt: "desc" } })` call it replaces (NULLS LAST is Postgres's - * default `desc` behavior, so ties/no-messages-yet inboxes sort last, same - * as before). + * `dateTimeBasedTrigger`, or a stale/foreign threaded id). Replaces a + * `db.query.contactInboxModel.findFirst({ orderBy: { lastMessageAt: + * "desc" } })` call; `NULLS LAST` is explicit because Postgres sorts nulls + * FIRST on `DESC` by default, which would prefer an inbox that never had a + * message. */ async findMostRecentByContact( input: { contactId: string; workspaceId: string }, @@ -198,7 +202,44 @@ export const contactInboxRepository = { ), ) .where(eq(contactInboxModel.contactId, input.contactId)) - .orderBy(desc(contactInboxModel.lastMessageAt)) + .orderBy(mostRecentMessageFirst()) + .limit(1) + + return row ?? null + }, + + /** + * The most recently active contact-inbox in one inbox — the recipient a + * "Send test event" CAPI check is attributed to, since Meta requires a real + * page-scoped id / phone number even for test events. `requireCtwaClid` + * narrows to click-to-WhatsApp-attributed rows, the only ones Meta accepts + * for a WhatsApp business-messaging event. + */ + async findMostRecentByInbox( + input: { inboxId: string; workspaceId: string; requireCtwaClid?: boolean }, + tx: DatabaseClient = db, + ): Promise { + const [row] = await tx + .select({ + id: contactInboxModel.id, + channel: contactInboxModel.channel, + inboxId: contactInboxModel.inboxId, + }) + .from(contactInboxModel) + .innerJoin( + inboxModel, + and( + eq(inboxModel.id, contactInboxModel.inboxId), + eq(inboxModel.workspaceId, input.workspaceId), + ), + ) + .where( + and( + eq(contactInboxModel.inboxId, input.inboxId), + input.requireCtwaClid ? ctwaReferralCondition() : undefined, + ), + ) + .orderBy(mostRecentMessageFirst()) .limit(1) return row ?? null diff --git a/packages/database/src/repositories/integration-instagram/repository.ts b/packages/database/src/repositories/integration-instagram/repository.ts index aa56eb619f..a230b6570c 100644 --- a/packages/database/src/repositories/integration-instagram/repository.ts +++ b/packages/database/src/repositories/integration-instagram/repository.ts @@ -23,6 +23,10 @@ type UpdateDatasetIdIfNullInput = WorkspaceIntegrationRef & { datasetId: string } +type UpdateCapiTestEventCodeInput = WorkspaceIntegrationRef & { + capiTestEventCode: string | null +} + type UpdateCapiAccessTokenInput = WorkspaceIntegrationRef & { capiAccessToken: EncryptedData } @@ -142,6 +146,18 @@ export const integrationInstagramRepository = { return row ?? null }, + async updateCapiTestEventCode( + input: UpdateCapiTestEventCodeInput, + tx: DatabaseClient = db, + ): Promise { + const [row] = await tx + .update(integrationInstagramModel) + .set({ capiTestEventCode: input.capiTestEventCode }) + .where(workspaceIntegrationFilter(input)) + .returning() + + return row ?? null + }, async updateCapiAccessToken( input: UpdateCapiAccessTokenInput, diff --git a/packages/database/src/repositories/integration-messenger/repository.ts b/packages/database/src/repositories/integration-messenger/repository.ts index 128d631c2d..cf511dc48a 100644 --- a/packages/database/src/repositories/integration-messenger/repository.ts +++ b/packages/database/src/repositories/integration-messenger/repository.ts @@ -23,6 +23,10 @@ type UpdateDatasetIdIfNullInput = WorkspaceIntegrationRef & { datasetId: string } +type UpdateCapiTestEventCodeInput = WorkspaceIntegrationRef & { + capiTestEventCode: string | null +} + type UpdateCapiAccessTokenInput = WorkspaceIntegrationRef & { capiAccessToken: EncryptedData } @@ -162,6 +166,18 @@ export const integrationMessengerRepository = { return row ?? null }, + async updateCapiTestEventCode( + input: UpdateCapiTestEventCodeInput, + tx: DatabaseClient = db, + ): Promise { + const [row] = await tx + .update(integrationMessengerModel) + .set({ capiTestEventCode: input.capiTestEventCode }) + .where(workspaceIntegrationFilter(input)) + .returning() + + return row ?? null + }, async updateCapiAccessToken( input: UpdateCapiAccessTokenInput, diff --git a/packages/database/src/repositories/integration-whatsapp/repository.ts b/packages/database/src/repositories/integration-whatsapp/repository.ts index ba199e1e28..04fa697743 100644 --- a/packages/database/src/repositories/integration-whatsapp/repository.ts +++ b/packages/database/src/repositories/integration-whatsapp/repository.ts @@ -106,6 +106,10 @@ type UpdateDatasetIdIfNullInput = WorkspaceIntegrationRef & { datasetId: string } +type UpdateCapiTestEventCodeInput = WorkspaceIntegrationRef & { + capiTestEventCode: string | null +} + type UpdateCapiAccessTokenInput = WorkspaceIntegrationRef & { capiAccessToken: EncryptedData } @@ -440,6 +444,19 @@ class IntegrationWhatsappRepository { return row ?? null } + async updateCapiTestEventCode( + input: UpdateCapiTestEventCodeInput, + tx: DatabaseClient = db, + ): Promise { + const [row] = await tx + .update(integrationWhatsappModel) + .set({ capiTestEventCode: input.capiTestEventCode }) + .where(workspaceIntegrationFilter(input)) + .returning() + + return row ?? null + } + async updateCapiAccessToken( input: UpdateCapiAccessTokenInput, tx: DatabaseClient = db, diff --git a/packages/database/src/schema/automation-throttle.ts b/packages/database/src/schema/automation-throttle.ts index cafa232986..850ccf35bc 100644 --- a/packages/database/src/schema/automation-throttle.ts +++ b/packages/database/src/schema/automation-throttle.ts @@ -17,8 +17,8 @@ export const automationThrottleType = pgEnum( ) /** - * Postgres source of truth for the hybrid automation throttle (see - * `docs/plans/default-reply-throttle-hybrid.md`). This model is **typing + * Postgres source of truth for the hybrid automation throttle. This model is + * **typing * only** — the physical table is hash-partitioned by `workspaceId` (×32) via * a hand-written migration (`drizzle-database` skill: partitioned tables * cannot be expressed through `pgTable`/`make:migration`), mirroring diff --git a/packages/database/src/schema/integration-instagram.ts b/packages/database/src/schema/integration-instagram.ts index 4423f7cca7..170d2d839e 100644 --- a/packages/database/src/schema/integration-instagram.ts +++ b/packages/database/src/schema/integration-instagram.ts @@ -40,6 +40,9 @@ export const integrationInstagramModel = pgTable( datasetId: text(), capiAccessToken: jsonb().$type(), capiDisconnectedAt: timestamp(timestampConfig), + // Meta Events Manager "test_event_code": while set, every CAPI event for + // this integration is routed to the dataset's Test Events view. + capiTestEventCode: text(), conversationStarters: jsonb() .$type() .array() diff --git a/packages/database/src/schema/integration-messenger.ts b/packages/database/src/schema/integration-messenger.ts index 57db3c89cc..87dd1a53a5 100644 --- a/packages/database/src/schema/integration-messenger.ts +++ b/packages/database/src/schema/integration-messenger.ts @@ -49,6 +49,9 @@ export const integrationMessengerModel = pgTable( datasetId: text(), capiAccessToken: jsonb().$type(), capiDisconnectedAt: timestamp(timestampConfig), + // Meta Events Manager "test_event_code": while set, every CAPI event for + // this integration is routed to the dataset's Test Events view. + capiTestEventCode: text(), workspaceId: bigintAsString() .notNull() .references(() => workspaceModel.id, { diff --git a/packages/database/src/schema/integration-whatsapp.ts b/packages/database/src/schema/integration-whatsapp.ts index c0a10648e6..2670153d9c 100644 --- a/packages/database/src/schema/integration-whatsapp.ts +++ b/packages/database/src/schema/integration-whatsapp.ts @@ -66,6 +66,9 @@ export const integrationWhatsappModel = pgTable( datasetId: text(), capiAccessToken: jsonb().$type(), capiDisconnectedAt: timestamp(timestampConfig), + // Meta Events Manager "test_event_code": while set, every CAPI event for + // this integration is routed to the dataset's Test Events view. + capiTestEventCode: text(), registrationStatus: whatsappRegistrationStatus() .notNull() .default("pending_verification"), diff --git a/packages/database/src/schema/meta-capi-event.ts b/packages/database/src/schema/meta-capi-event.ts index 8f0c41d231..7543e666e9 100644 --- a/packages/database/src/schema/meta-capi-event.ts +++ b/packages/database/src/schema/meta-capi-event.ts @@ -1,7 +1,13 @@ +import type { + MetaCapiActionSource, + MetaCapiContentType, + MetaCapiEventName, +} from "@chatbotx.io/utils/meta-capi" import { sql } from "drizzle-orm" import { check, index, + jsonb, numeric, pgTable, text, @@ -17,13 +23,29 @@ import { import { contactInboxModel } from "./contact-inbox" import { workspaceModel } from "./workspace" +export { + type MetaCapiActionSource, + type MetaCapiContentType, + type MetaCapiEventName, + metaCapiActionSourceSchema, + metaCapiActionSourceValues, + metaCapiContentTypeSchema, + metaCapiContentTypeValues, + metaCapiEventNameSchema, +} from "@chatbotx.io/utils/meta-capi" + export const metaCapiEventChannelValues = [ "messenger", "instagram", "whatsapp", ] as const -export const metaCapiEventNameValues = ["LeadSubmitted", "Purchase"] as const -export const metaCapiEventSourceValues = ["flowStep", "triggerAction"] as const +export const metaCapiEventSourceValues = [ + "flowStep", + "triggerAction", + // "Send test event" from the CAPI settings tab — only ever sent with a + // test_event_code, never as a production event. + "manualTest", +] as const export const metaCapiStatusValues = [ "pending", "sent", @@ -39,9 +61,6 @@ export const metaCapiStatusValues = [ export const metaCapiEventChannelSchema = z.enum(metaCapiEventChannelValues) export type MetaCapiEventChannel = z.infer -export const metaCapiEventNameSchema = z.enum(metaCapiEventNameValues) -export type MetaCapiEventName = z.infer - export const metaCapiEventSourceSchema = z.enum(metaCapiEventSourceValues) export type MetaCapiEventSource = z.infer @@ -75,6 +94,16 @@ export const metaCapiEventModel = pgTable( contentCategory: text(), contentName: text(), value: numeric(), + // Meta CAPI `action_source` — see `metaCapiActionSourcePolicy` in + // `@chatbotx.io/utils/meta-capi` for how each value drives identity and + // event-catalog selection. Defaulted so existing rows (and existing + // steps/actions parsing through zod `.default()`) stay `business_messaging`. + actionSource: text() + .$type() + .notNull() + .default("business_messaging"), + contentType: text().$type(), + contentIds: jsonb().$type(), source: text().$type().notNull(), sourceKey: text().notNull(), occurredAt: timestamp(timestampConfig).notNull(), @@ -101,5 +130,13 @@ export const metaCapiEventModel = pgTable( "MetaCapiEvent_channel_check", sql`"channel" IN ('messenger', 'instagram', 'whatsapp')`, ), + check( + "MetaCapiEvent_actionSource_check", + sql`"actionSource" IN ('business_messaging', 'email', 'phone_call', 'chat', 'physical_store', 'system_generated', 'other')`, + ), + check( + "MetaCapiEvent_contentType_check", + sql`"contentType" IN ('product', 'product_group')`, + ), ], ) diff --git a/packages/flow-config/__tests__/send-meta-capi-event.test.ts b/packages/flow-config/__tests__/send-meta-capi-event.test.ts index 05042e5528..6b919185de 100644 --- a/packages/flow-config/__tests__/send-meta-capi-event.test.ts +++ b/packages/flow-config/__tests__/send-meta-capi-event.test.ts @@ -1,3 +1,9 @@ +import { + metaCapiActionSourceValues, + metaCapiBusinessMessagingEventNames, + metaCapiContentTypeValues, + metaPixelStandardEventNames, +} from "@chatbotx.io/utils/meta-capi" import { describe, expect, test } from "vitest" import { actionSteps, @@ -12,6 +18,7 @@ describe("Send Meta CAPI event flow contract", () => { expect.objectContaining({ stepType: "sendMetaCapiEvent", eventName: "LeadSubmitted", + actionSource: "business_messaging", }), ) }) @@ -25,13 +32,15 @@ describe("Send Meta CAPI event flow contract", () => { ).toThrow() }) - test("rejects unsupported event names", () => { - expect(() => - sendMetaCapiEventSchema.parse({ - ...sendMetaCapiEventDefaultFn(), - eventName: "Purchase", - }), - ).toThrow() + test("accepts Purchase for the default business_messaging action source (with required value/currency)", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + value: "10", + currency: "USD", + }) + + expect(parsed.eventName).toBe("Purchase") }) test("accepts numeric value text", () => { @@ -61,7 +70,7 @@ describe("Send Meta CAPI event flow contract", () => { ).toThrow() }) - test("normalizes currency codes to uppercase", () => { + test("normalizes static currency codes to uppercase", () => { expect( sendMetaCapiEventSchema.parse({ ...sendMetaCapiEventDefaultFn(), @@ -107,6 +116,7 @@ describe("Send Meta CAPI event flow contract", () => { expect(value).toMatchObject({ stepType: "sendMetaCapiEvent", eventName: "LeadSubmitted", + actionSource: "business_messaging", }) expect(value.states.map((state) => state.stateType)).toEqual([ "success", @@ -123,4 +133,315 @@ describe("Send Meta CAPI event flow contract", () => { actionSteps.some((schema) => schema.safeParse(defaults).success), ).toBe(true) }) + + describe("business_messaging event catalog", () => { + test.each( + metaCapiBusinessMessagingEventNames, + )("accepts standard business-messaging event %s", (eventName) => { + const requiresValue = eventName === "Purchase" + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "business_messaging", + eventName, + ...(requiresValue ? { value: "10", currency: "USD" } : {}), + }) + + expect(parsed.eventName).toBe(eventName) + }) + + test("rejects a pixel-only event name (Lead) for business_messaging", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "business_messaging", + eventName: "Lead", + }), + ).toThrow() + }) + + test("rejects a custom event name for business_messaging", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "business_messaging", + eventName: "my-event", + }), + ).toThrow() + }) + }) + + describe("pixel event catalog (non-messaging action sources)", () => { + test.each( + metaPixelStandardEventNames, + )("accepts standard pixel event %s for email", (eventName) => { + const requiresValue = eventName === "Purchase" + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName, + ...(requiresValue ? { value: "10", currency: "USD" } : {}), + }) + + expect(parsed.eventName).toBe(eventName) + }) + + test("rejects a business-messaging-only event name (LeadSubmitted) for email", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName: "LeadSubmitted", + }), + ).toThrow() + }) + + test.each([ + "Order.Completed", + "my-event", + "1x", + "x".repeat(50), + ])("accepts custom event name %s for email", (eventName) => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName, + }) + + expect(parsed.eventName).toBe(eventName) + }) + + test("rejects a custom event name over 50 characters for email", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName: "x".repeat(51), + }), + ).toThrow() + }) + + test("rejects an empty custom event name for email", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName: "", + }), + ).toThrow() + }) + + test("rejects a whitespace-only custom event name for email", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName: " ", + }), + ).toThrow() + }) + }) + + describe("action_source", () => { + test.each( + metaCapiActionSourceValues, + )("accepts action source %s", (actionSource) => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource, + eventName: "Purchase", + value: "10", + currency: "USD", + }) + + expect(parsed.actionSource).toBe(actionSource) + }) + + test.each([ + "website", + "app", + ])("rejects excluded action source %s", (actionSource) => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource, + }), + ).toThrow() + }) + }) + + describe("content_type", () => { + test.each( + metaCapiContentTypeValues, + )("accepts content type %s", (contentType) => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + contentType, + }) + + expect(parsed.contentType).toBe(contentType) + }) + + test("rejects an invalid content type", () => { + expect(() => + sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + contentType: "digital_good", + }), + ).toThrow() + }) + }) + + describe("Purchase value/currency requirement", () => { + test("rejects Purchase missing both value and currency", () => { + const result = sendMetaCapiEventSchema.safeParse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + }) + + expect(result.success).toBe(false) + if (!result.success) { + const paths = result.error.issues.map((issue) => issue.path.join(".")) + expect(paths).toContain("value") + expect(paths).toContain("currency") + } + }) + + test("rejects Purchase missing only value", () => { + const result = sendMetaCapiEventSchema.safeParse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + currency: "USD", + }) + + expect(result.success).toBe(false) + if (!result.success) { + const paths = result.error.issues.map((issue) => issue.path.join(".")) + expect(paths).toContain("value") + } + }) + + test("rejects Purchase missing only currency", () => { + const result = sendMetaCapiEventSchema.safeParse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + value: "10", + }) + + expect(result.success).toBe(false) + if (!result.success) { + const paths = result.error.issues.map((issue) => issue.path.join(".")) + expect(paths).toContain("currency") + } + }) + + test("accepts Purchase with both value and currency", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + value: "10", + currency: "USD", + }) + + expect(parsed.value).toBe("10") + expect(parsed.currency).toBe("USD") + }) + + test.each([ + "AddToCart", + "ViewContent", + "LeadSubmitted", + ])("accepts %s without value or currency", (eventName) => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + eventName, + }) + + expect(parsed.value).toBeUndefined() + expect(parsed.currency).toBeUndefined() + }) + + test("accepts a custom event name without value or currency", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + actionSource: "email", + eventName: "my-event", + }) + + expect(parsed.value).toBeUndefined() + expect(parsed.currency).toBeUndefined() + }) + }) + + describe("template values", () => { + test("accepts a {{variable}} value verbatim", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + value: "{{order_total}}", + currency: "USD", + }) + + expect(parsed.value).toBe("{{order_total}}") + }) + + test("does not uppercase a {{variable}} currency", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + eventName: "Purchase", + value: "10", + currency: "{{currency}}", + }) + + expect(parsed.currency).toBe("{{currency}}") + }) + + test("accepts template contentIds verbatim", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + contentIds: "{{a}},{{b}}", + }) + + expect(parsed.contentIds).toBe("{{a}},{{b}}") + }) + + test("accepts a static contentIds value verbatim", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + contentIds: "SKU-1, SKU-2", + }) + + expect(parsed.contentIds).toBe("SKU-1, SKU-2") + }) + + test("treats a whitespace-only contentIds value as unset", () => { + const parsed = sendMetaCapiEventSchema.parse({ + ...sendMetaCapiEventDefaultFn(), + contentIds: " ", + }) + + expect(parsed.contentIds).toBeUndefined() + }) + }) + + test("parses a stored step from before actionSource existed, with defaults applied", () => { + const legacyStoredStep = { + id: "123456789012345678", + stepType: "sendMetaCapiEvent", + eventName: "LeadSubmitted", + value: "10", + currency: "USD", + contentCategory: "Education", + contentName: "Course", + states: sendMetaCapiEventDefaultFn().states, + } + + const parsed = sendMetaCapiEventSchema.parse(legacyStoredStep) + + expect(parsed.actionSource).toBe("business_messaging") + expect(parsed.eventName).toBe("LeadSubmitted") + expect(parsed.value).toBe("10") + expect(parsed.currency).toBe("USD") + expect(parsed.contentCategory).toBe("Education") + expect(parsed.contentName).toBe("Course") + }) }) diff --git a/packages/flow-config/src/steps/send-meta-capi-event.ts b/packages/flow-config/src/steps/send-meta-capi-event.ts index d4715c5b18..edfd418a54 100644 --- a/packages/flow-config/src/steps/send-meta-capi-event.ts +++ b/packages/flow-config/src/steps/send-meta-capi-event.ts @@ -1,4 +1,17 @@ import { createId, zodBigintAsString } from "@chatbotx.io/utils" +import { + defaultMetaCapiActionSource, + eventNamesByCatalog, + type MetaCapiActionSource, + metaCapiActionSourcePolicy, + metaCapiActionSourceSchema, + metaCapiBusinessMessagingEventNames, + metaCapiContentTypeSchema, + metaCapiCurrencySchema, + metaCapiEventNameSchema, + metaCapiValueSchema, +} from "@chatbotx.io/utils/meta-capi" +import { containsVariablePlaceholder } from "@chatbotx.io/utils/variables" import { z } from "zod" import { errorStateDefaultFn, @@ -8,55 +21,214 @@ import { } from "../states" import { stepTypes } from "./step-action" -export const metaCapiFlowEventNameSchema = z.enum(["LeadSubmitted"]) - // Treat an empty/blank string (a cleared input field) as "unset" so users can // remove a previously entered value/currency without hitting regex validation. const blankToUndefined = (value: unknown) => typeof value === "string" && value.trim() === "" ? undefined : value -export const metaCapiValueSchema = z.preprocess( - blankToUndefined, - z - .string() - .trim() - .regex(/^\d+(\.\d+)?$/) - .optional(), +/** + * `value`, `currency` and `contentIds` each accept either a static value + * (validated/normalized by `staticSchema`) or a `{{variable}}` template, + * passed through untouched — a static schema's `.toUpperCase()` or regex + * would otherwise corrupt/reject a template placeholder such as + * `{{currency_field}}` or `{{order_total}}`. + */ +export const templateOrStatic = ( + staticSchema: z.ZodType, +) => + z.string().transform((value, ctx): TOutput | string => { + if (containsVariablePlaceholder(value)) { + return value + } + + const result = staticSchema.safeParse(value) + if (result.success) { + return result.data + } + + for (const issue of result.error.issues) { + ctx.addIssue(issue.message) + } + return z.NEVER + }) + +const metaCapiContentIdsStaticSchema = z.string().trim().min(1) + +/** + * Shared shape for the three template-or-static optional fields below: treat + * a blank string as unset, otherwise accept either a `{{variable}}` + * placeholder or a value matching `staticSchema`. + */ +const optionalTemplateOrStatic = ( + staticSchema: z.ZodType, +) => z.preprocess(blankToUndefined, templateOrStatic(staticSchema).optional()) + +const metaCapiValueFieldSchema = optionalTemplateOrStatic(metaCapiValueSchema) + +const metaCapiCurrencyFieldSchema = optionalTemplateOrStatic( + metaCapiCurrencySchema, ) -export const metaCapiCurrencySchema = z.preprocess( - blankToUndefined, - z - .string() - .trim() - .toUpperCase() - .pipe(z.string().regex(/^[A-Z]{3}$/)) - .optional(), +// Comma-separated Meta `content_ids` (e.g. "123,456" or "{{a}},{{b}}"); split +// into a `string[]` at the business-layer boundary (`enqueueEventInput`), not +// here — the flow-field value is a plain template-or-static string. +const metaCapiContentIdsSchema = optionalTemplateOrStatic( + metaCapiContentIdsStaticSchema, ) // Optional Meta Pixel content properties (content_category / content_name), // passed through CAPI custom_data. -export const metaCapiContentTextSchema = z.preprocess( +const metaCapiContentTextSchema = z.preprocess( blankToUndefined, z.string().trim().min(1).max(200).optional(), ) -export const sendMetaCapiEventSchema = z.object({ - id: zodBigintAsString(), - stepType: z.literal(stepTypes.enum.sendMetaCapiEvent), - eventName: metaCapiFlowEventNameSchema.default("LeadSubmitted"), - value: metaCapiValueSchema, - currency: metaCapiCurrencySchema, +/** + * Event names requiring `value`/`currency`. Meta: "Required for purchase + * events" — every other standard or custom event is optional. + */ +const eventsRequiringValueAndCurrency: ReadonlySet = new Set([ + "Purchase", +]) + +/** + * Minimal shape both `superRefine` callbacks below are typed against, so the + * same callbacks are assignable to any host schema that carries these four + * fields — the flow-step schema here, the builder trigger-action schema, and + * `enqueueEventInput` in `packages/business` (where `contentIds` is already + * a `string[]`, a field these callbacks never read). + */ +export type MetaCapiEventRefinementFields = { + eventName: string + actionSource: MetaCapiActionSource + value?: string + currency?: string +} + +/** Purchase requires `value` and `currency`; every other event is optional. */ +export const requireValueAndCurrencyForEvent = ( + data: MetaCapiEventRefinementFields, + ctx: z.RefinementCtx, +): void => { + if (!eventsRequiringValueAndCurrency.has(data.eventName)) { + return + } + + if (!data.value) { + ctx.addIssue({ + code: "custom", + path: ["value"], + message: `Value is required for ${data.eventName} events`, + }) + } + + if (!data.currency) { + ctx.addIssue({ + code: "custom", + path: ["currency"], + message: `Currency is required for ${data.eventName} events`, + }) + } +} + +/** + * Which event names are valid is a property of `actionSource`'s catalog — + * `business_messaging` only offers its 14 documented events (no custom + * names); every other action source offers the 17 Meta Pixel standard + * events plus custom names (already bounded to <=50 chars by + * `metaCapiEventNameSchema` at the field level). A custom name is never + * allowed to shadow the *other* catalog's standard event name (e.g. + * `LeadSubmitted` — a business-messaging event — is not a valid custom + * name for a pixel-catalog action source such as `email`), since that name + * is already reserved for the other, semantically distinct, action source. + */ +export const requireEventNameAllowedForActionSource = ( + data: MetaCapiEventRefinementFields, + ctx: z.RefinementCtx, +): void => { + const policy = metaCapiActionSourcePolicy[data.actionSource] + const ownCatalogNames = eventNamesByCatalog[policy.eventCatalog] + + if (ownCatalogNames.includes(data.eventName)) { + return + } + + if (!policy.allowsCustomEventNames) { + ctx.addIssue({ + code: "custom", + path: ["eventName"], + message: `"${data.eventName}" is not a supported event for the ${data.actionSource} action source`, + }) + return + } + + // Only the pixel catalog reaches here (it is the only catalog that allows + // custom names) — a custom name must not shadow a business-messaging + // catalog standard event name, which is reserved for that other, + // semantically distinct, action source. + if ( + (metaCapiBusinessMessagingEventNames as readonly string[]).includes( + data.eventName, + ) + ) { + ctx.addIssue({ + code: "custom", + path: ["eventName"], + message: `"${data.eventName}" is reserved by another action source's event catalog and cannot be used as a custom event name`, + }) + } +} + +/** + * Shared field-set schema, reused by the flow step (this file), the builder + * trigger action, and the worker trigger executor's `safeParse` of the + * stored trigger action object. + */ +export const metaCapiEventFieldsSchema = z.object({ + eventName: metaCapiEventNameSchema.default("LeadSubmitted"), + actionSource: metaCapiActionSourceSchema.default(defaultMetaCapiActionSource), + contentType: metaCapiContentTypeSchema.optional(), + contentIds: metaCapiContentIdsSchema, + value: metaCapiValueFieldSchema, + currency: metaCapiCurrencyFieldSchema, contentCategory: metaCapiContentTextSchema, contentName: metaCapiContentTextSchema, - states: z.tuple([successStateSchema, errorStateSchema]), }) +export type MetaCapiEventFieldsSchema = z.infer< + typeof metaCapiEventFieldsSchema +> + +/** + * The two cross-field rules every host of the CAPI fields applies — flow + * step, trigger action (builder + worker), the dialog resolver and the + * business `enqueueEventInput`. One composition so a rule added later cannot + * reach some hosts and not others. + */ +export const withMetaCapiEventRefinements = < + TSchema extends z.ZodType, +>( + schema: TSchema, +): TSchema => + schema + .superRefine(requireValueAndCurrencyForEvent) + .superRefine(requireEventNameAllowedForActionSource) + +export const sendMetaCapiEventSchema = withMetaCapiEventRefinements( + metaCapiEventFieldsSchema.extend({ + id: zodBigintAsString(), + stepType: z.literal(stepTypes.enum.sendMetaCapiEvent), + states: z.tuple([successStateSchema, errorStateSchema]), + }), +) export type SendMetaCapiEventSchema = z.infer export const sendMetaCapiEventDefaultFn = (): SendMetaCapiEventSchema => ({ id: createId(), stepType: stepTypes.enum.sendMetaCapiEvent, eventName: "LeadSubmitted", + actionSource: "business_messaging", + contentType: undefined, + contentIds: undefined, value: undefined, currency: undefined, contentCategory: undefined, diff --git a/packages/ui/src/components/form/combobox-field.tsx b/packages/ui/src/components/form/combobox-field.tsx index 9ecfbc4014..df67aaaa0a 100644 --- a/packages/ui/src/components/form/combobox-field.tsx +++ b/packages/ui/src/components/form/combobox-field.tsx @@ -64,6 +64,7 @@ export type ComboboxFieldProps = { emptyText?: string description?: string descriptionType?: "inline" | "tooltip" + hideMessage?: boolean formItemClassName?: string options: SelectOption[] className?: string @@ -88,6 +89,7 @@ export function ComboboxField({ emptyText, description, descriptionType = "inline", + hideMessage, formItemClassName, options, side, @@ -116,6 +118,7 @@ export function ComboboxField({ description={description} descriptionType={descriptionType} formItemClassName={formItemClassName} + hideMessage={hideMessage} label={label} name={name} required={required} diff --git a/packages/ui/src/components/form/field-wrapper.tsx b/packages/ui/src/components/form/field-wrapper.tsx index 4d3fafae2e..27d1ae6853 100644 --- a/packages/ui/src/components/form/field-wrapper.tsx +++ b/packages/ui/src/components/form/field-wrapper.tsx @@ -23,6 +23,10 @@ type FormFieldWrapperProps = { required?: boolean description?: string descriptionType?: "inline" | "tooltip" + /** When set, the tooltip info icon also links to this URL (opens in a new tab). */ + descriptionHref?: string + /** Suppress the inline error message (e.g. when a sibling control bound to the same field already shows it). */ + hideMessage?: boolean formItemClassName?: string children: ( field: { @@ -40,6 +44,8 @@ export function FormFieldWrapper({ required, description, descriptionType = "inline", + descriptionHref, + hideMessage = false, formItemClassName, children, }: FormFieldWrapperProps) { @@ -63,11 +69,36 @@ export function FormFieldWrapper({ + descriptionHref ? ( + + + ) : ( + + ) } /> - {description} + {descriptionHref ? ( + + {description} + + ) : ( + description + )} ) : null} @@ -77,7 +108,7 @@ export function FormFieldWrapper({ {description && descriptionType === "inline" ? ( {description} ) : null} - + {hideMessage ? null : } )} /> diff --git a/packages/ui/src/components/form/select-field.tsx b/packages/ui/src/components/form/select-field.tsx index 2028d8c1ff..7fc039b6c4 100644 --- a/packages/ui/src/components/form/select-field.tsx +++ b/packages/ui/src/components/form/select-field.tsx @@ -33,6 +33,7 @@ export type SelectFieldProps = React.ComponentProps< placeholder?: string description?: string descriptionType?: "inline" | "tooltip" + descriptionHref?: string options?: SelectOption[] fetchOptionsUrl?: string formItemClassName?: string @@ -62,6 +63,7 @@ export const SelectField = ( placeholder, description, descriptionType = "inline", + descriptionHref, options = [], fetchOptionsUrl, formItemClassName, @@ -150,6 +152,7 @@ export const SelectField = ( return ( description={description} + descriptionHref={descriptionHref} descriptionType={descriptionType} formItemClassName={formItemClassName} label={label} diff --git a/packages/utils/__tests__/meta-capi.test.ts b/packages/utils/__tests__/meta-capi.test.ts new file mode 100644 index 0000000000..fc2e1cd27a --- /dev/null +++ b/packages/utils/__tests__/meta-capi.test.ts @@ -0,0 +1,111 @@ +import { describe, expect, test } from "vitest" +import { + defaultEventNameByCatalog, + metaCapiActionSourcePolicy, + metaCapiActionSourceValues, + metaCapiBusinessMessagingEventNames, + metaCapiContentTypeValues, + metaCapiCurrencySchema, + metaCapiEventNameSchema, + metaCapiValueSchema, + metaPixelStandardEventNames, +} from "../src/meta-capi" + +describe("metaCapiActionSourcePolicy", () => { + test("has exactly one entry per offered action source", () => { + expect(Object.keys(metaCapiActionSourcePolicy).sort()).toEqual( + [...metaCapiActionSourceValues].sort(), + ) + }) + + test("only business_messaging uses the messaging identity and business-messaging catalog", () => { + for (const actionSource of metaCapiActionSourceValues) { + const policy = metaCapiActionSourcePolicy[actionSource] + const isBusinessMessaging = actionSource === "business_messaging" + + expect(policy.usesMessagingIdentity).toBe(isBusinessMessaging) + expect(policy.eventCatalog).toBe( + isBusinessMessaging ? "businessMessaging" : "pixel", + ) + expect(policy.allowsCustomEventNames).toBe(!isBusinessMessaging) + } + }) +}) + +describe("event name catalogs", () => { + test("business-messaging catalog has Meta's 14 documented events", () => { + expect(metaCapiBusinessMessagingEventNames).toHaveLength(14) + expect(metaCapiBusinessMessagingEventNames).toContain("LeadSubmitted") + }) + + test("pixel catalog has Meta's 17 standard events", () => { + expect(metaPixelStandardEventNames).toHaveLength(17) + expect(metaPixelStandardEventNames).toContain("Lead") + }) + + test("defaults each catalog to its documented default event", () => { + expect(defaultEventNameByCatalog.businessMessaging).toBe("LeadSubmitted") + expect(defaultEventNameByCatalog.pixel).toBe("Lead") + }) +}) + +describe("metaCapiEventNameSchema", () => { + test("accepts a standard or custom event name up to 50 characters", () => { + expect(metaCapiEventNameSchema.safeParse("Purchase").success).toBe(true) + expect(metaCapiEventNameSchema.safeParse("my-custom-event").success).toBe( + true, + ) + expect(metaCapiEventNameSchema.safeParse("a".repeat(50)).success).toBe(true) + }) + + test("rejects an empty, whitespace-only, or over-length event name", () => { + expect(metaCapiEventNameSchema.safeParse("").success).toBe(false) + expect(metaCapiEventNameSchema.safeParse(" ").success).toBe(false) + expect(metaCapiEventNameSchema.safeParse("a".repeat(51)).success).toBe( + false, + ) + }) +}) + +describe("metaCapiContentTypeValues", () => { + test("only offers Meta's two documented content types", () => { + expect(metaCapiContentTypeValues).toEqual(["product", "product_group"]) + }) +}) + +describe("metaCapiValueSchema / metaCapiCurrencySchema", () => { + test.each([ + "19.99", + " 250 ", + "0", + "9007199254740991", + ])("accepts plain decimal %j", (input) => { + expect(metaCapiValueSchema.safeParse(input).success).toBe(true) + }) + + test.each([ + "12,50", + "1e5", + "-5", + "abc", + "{{amount}}", + "", + "1.", + ".5", + ])("rejects non-canonical value %j", (input) => { + expect(metaCapiValueSchema.safeParse(input).success).toBe(false) + }) + + test("rejects a value that would not survive Number() intact", () => { + expect(metaCapiValueSchema.safeParse("9007199254740992").success).toBe( + false, + ) + expect(metaCapiValueSchema.safeParse("1".repeat(400)).success).toBe(false) + }) + + test("currency is upper-cased and must be a 3-letter code", () => { + expect(metaCapiCurrencySchema.parse(" usd ")).toBe("USD") + expect(metaCapiCurrencySchema.safeParse("US").success).toBe(false) + expect(metaCapiCurrencySchema.safeParse("USDT").success).toBe(false) + }) +}) diff --git a/packages/utils/src/meta-capi.ts b/packages/utils/src/meta-capi.ts index 386812f952..80920f8a36 100644 --- a/packages/utils/src/meta-capi.ts +++ b/packages/utils/src/meta-capi.ts @@ -1,11 +1,13 @@ /** - * Low-level, dependency-free wire-adjacent types for Meta's Conversions API - * for Business Messaging. Lives here (not `packages/business`) so - * `integrations/meta-conversions` — which deliberately does NOT depend on + * Low-level wire-adjacent types and shared enums for Meta's Conversions API + * (CAPI) — for both Business Messaging and Pixel/server events. Depends + * only on zod, like `utils/variables.ts`. Lives here (not `packages/business`) + * so `integrations/meta-conversions` — which deliberately does NOT depend on * `@chatbotx.io/business` — can still import these shapes, and so - * `packages/database`'s `AdsConversionEvent.contents` column can use the same - * type its writers do. + * `packages/database`'s `AdsConversionEvent.contents` / `MetaCapiEvent.*` + * columns can use the same types their writers do. */ +import { z } from "zod" /** * Hash-only Meta Conversions API `user_data` customer-information fields. @@ -37,3 +39,213 @@ export type PurchaseContentItem = { quantity: number itemPrice: number } + +/** + * Meta's 14 documented Business Messaging CAPI events + * (https://developers.facebook.com/docs/marketing-api/conversions-api/business-messaging). + * Offered only when `action_source` is `business_messaging` — that endpoint's + * docs list these events and never mention custom event names, so this + * catalog is closed (no custom names — see `metaCapiActionSourcePolicy`). + */ +export const metaCapiBusinessMessagingEventNames = [ + "Purchase", + "LeadSubmitted", + "InitiateCheckout", + "AddToCart", + "ViewContent", + "OrderCreated", + "OrderShipped", + "OrderDelivered", + "OrderCanceled", + "OrderReturned", + "CartAbandoned", + "QualifiedLead", + "RatingProvided", + "ReviewProvided", +] as const + +/** + * Meta Pixel's 17 standard events + * (https://developers.facebook.com/docs/meta-pixel/reference). Offered for + * every `action_source` other than `business_messaging`, alongside custom + * event names (see `metaCapiActionSourcePolicy`). + */ +export const metaPixelStandardEventNames = [ + "AddPaymentInfo", + "AddToCart", + "AddToWishlist", + "CompleteRegistration", + "Contact", + "CustomizeProduct", + "Donate", + "FindLocation", + "InitiateCheckout", + "Lead", + "Purchase", + "Schedule", + "Search", + "StartTrial", + "SubmitApplication", + "Subscribe", + "ViewContent", +] as const + +/** + * Base validation rule for every CAPI `event_name` — standard or custom — + * per Meta's Pixel custom-events rule: "must be strings, and cannot exceed + * 50 characters in length" + * (https://developers.facebook.com/docs/meta-pixel/implementation/conversion-tracking). + * No extra charset restriction is published, so none is enforced here. + * Catalog membership (which names are valid for a given `action_source`) is + * a separate refinement built on top of this base rule, not part of it. + */ +export const metaCapiEventNameSchema = z.string().trim().min(1).max(50) + +/** + * `eventName` is a plain string at the type level (DB column, integration + * input, business input) — not a branded literal union — so every existing + * caller supplying a bare string literal (e.g. `capiEventNameByEventType` in + * the ads-conversion sender) keeps compiling. Catalog membership is enforced + * at validation time via `metaCapiEventNameSchema` plus the per-action-source + * catalog, not at the type level. + */ +export type MetaCapiEventName = string + +/** One of the two documented event catalogs an `action_source` can offer. */ +export type MetaCapiEventCatalog = "businessMessaging" | "pixel" + +/** Default `eventName` to preselect for each event catalog. */ +export const defaultEventNameByCatalog: Record = { + businessMessaging: "LeadSubmitted", + pixel: "Lead", +} + +/** Standard event names, looked up by which catalog they belong to. */ +export const eventNamesByCatalog: Record< + MetaCapiEventCatalog, + readonly string[] +> = { + businessMessaging: metaCapiBusinessMessagingEventNames, + pixel: metaPixelStandardEventNames, +} + +/** + * Meta's `action_source` values offered by ChatbotX + * (https://developers.facebook.com/documentation/ads-commerce/conversions-api/parameters/server-event#action_source). + * `website` and `app` are excluded: `event_source_url` and + * `client_user_agent` are each "required for website events", and `app_data` + * is "Required for app events" — none of which ChatbotX's messaging-driven + * flow/trigger steps can supply. + */ +export const metaCapiActionSourceValues = [ + "business_messaging", + "email", + "phone_call", + "chat", + "physical_store", + "system_generated", + "other", +] as const +export const metaCapiActionSourceSchema = z.enum(metaCapiActionSourceValues) +export type MetaCapiActionSource = z.infer + +/** + * The `action_source` a new step/action starts with, and what a stored step + * saved before the field existed is read as. + */ +export const defaultMetaCapiActionSource: MetaCapiActionSource = + "business_messaging" + +const PLAIN_DECIMAL_PATTERN = /^\d+(\.\d+)?$/ +const ISO_4217_PATTERN = /^[A-Z]{3}$/ + +/** + * Meta CAPI `custom_data.value`: a canonical plain decimal, already trimmed, + * with no locale normalisation ("12,50" is ambiguous between 12.50 and 1250) + * and small enough to survive `Number()` exactly — a digit string long + * enough to overflow to `Infinity` would otherwise serialise as `null`. + */ +export const metaCapiValueSchema = z + .string() + .trim() + .regex(PLAIN_DECIMAL_PATTERN, "Value must be a plain number such as 19.99") + .refine( + (value) => Number(value) <= Number.MAX_SAFE_INTEGER, + "Value is too large", + ) + +/** Meta CAPI `custom_data.currency`: a 3-letter ISO 4217 code, upper-cased. */ +export const metaCapiCurrencySchema = z + .string() + .trim() + .toUpperCase() + .pipe( + z + .string() + .regex( + ISO_4217_PATTERN, + "Currency must be a 3-letter ISO 4217 code such as USD", + ), + ) + +/** + * Meta CAPI `custom_data.content_type` values + * (https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/custom-data). + */ +export const metaCapiContentTypeValues = ["product", "product_group"] as const +export const metaCapiContentTypeSchema = z.enum(metaCapiContentTypeValues) +export type MetaCapiContentType = z.infer + +/** + * Single shared policy object keyed by `action_source`, driving both the + * builder UI's event-name catalog and the worker sender's identity + * strategy — no second map, no inline `=== "business_messaging"` literal + * outside this object. Only `business_messaging` uses the + * messaging-channel identity (page-scoped id / phone number + `ctwa_clid`); + * every other action source identifies the person via hashed customer + * information only (`HashedCapiUserData`). + */ +export const metaCapiActionSourcePolicy = { + business_messaging: { + usesMessagingIdentity: true, + eventCatalog: "businessMessaging", + allowsCustomEventNames: false, + }, + email: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, + phone_call: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, + chat: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, + physical_store: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, + system_generated: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, + other: { + usesMessagingIdentity: false, + eventCatalog: "pixel", + allowsCustomEventNames: true, + }, +} satisfies Record< + MetaCapiActionSource, + { + usesMessagingIdentity: boolean + eventCatalog: MetaCapiEventCatalog + allowsCustomEventNames: boolean + } +> diff --git a/scripts/normalize-field-values.mts b/scripts/normalize-field-values.mts index 1086b0b220..f062a3045c 100644 --- a/scripts/normalize-field-values.mts +++ b/scripts/normalize-field-values.mts @@ -1,5 +1,5 @@ /** - * Phase 5 backfill for docs/plans/2026-08-28-custom-field-value-normalization.md. + * Backfill for the custom/bot field value normalization. * * Legacy `ContactCustomField.value` / `BotField.value` rows written before the * write-side normalizer (packages/business/src/contact-custom-field/normalize.ts)