diff --git a/dembrane/frontend/src/lib/api.interceptor.test.ts b/dembrane/frontend/src/lib/api.interceptor.test.ts index 68f64de57..5c4cf4fc7 100644 --- a/dembrane/frontend/src/lib/api.interceptor.test.ts +++ b/dembrane/frontend/src/lib/api.interceptor.test.ts @@ -1,7 +1,12 @@ // @vitest-environment jsdom import type { AxiosAdapter } from "axios"; import { afterEach, expect, it, vi } from "vitest"; -import { api, apiNoAuth, initiateAndUploadConversationChunk } from "./api"; +import { + api, + apiNoAuth, + initiateAndUploadConversationChunk, + initiateConversation, +} from "./api"; vi.mock("@/components/common/Toaster", () => ({ toast: Object.assign(vi.fn(), { error: vi.fn(), success: vi.fn() }), @@ -53,3 +58,23 @@ it("an upload without a prefix is named after the file alone", async () => { expect(url).toBe("/participant/projects/p1/conversations/initiate"); expect((body as { name: string }).name).toBe("sofia.mp3"); }); + +it("initiateConversation includes consent in the request body when provided", async () => { + const post = vi + .spyOn(apiNoAuth, "post") + .mockResolvedValue({ id: "c1" } as never); + await initiateConversation({ + consent: { accepted: true, version: "2026-11-30" }, + name: "Table 1", + pin: "", + projectId: "p1", + source: "PORTAL_AUDIO", + tagIdList: [], + }); + expect(post).toHaveBeenCalledWith( + "/participant/projects/p1/conversations/initiate", + expect.objectContaining({ + consent: { accepted: true, version: "2026-11-30" }, + }), + ); +}); diff --git a/dembrane/frontend/src/lib/api.ts b/dembrane/frontend/src/lib/api.ts index 84841cb25..328f3984c 100644 --- a/dembrane/frontend/src/lib/api.ts +++ b/dembrane/frontend/src/lib/api.ts @@ -166,6 +166,11 @@ export const cloneProjectById = async ({ }); }; +export type InitiateConsentPayload = { + accepted: boolean; + version: string; +}; + export const initiateConversation = async (payload: { projectId: string; email?: string; @@ -174,10 +179,12 @@ export const initiateConversation = async (payload: { source: string; tagIdList: string[]; visitorId?: string; + consent?: InitiateConsentPayload; }) => { return apiNoAuth.post( `/participant/projects/${payload.projectId}/conversations/initiate`, { + consent: payload.consent, email: payload.email ?? undefined, name: payload.name, pin: payload.pin, diff --git a/dembrane/frontend/src/locales/cs-CZ.po b/dembrane/frontend/src/locales/cs-CZ.po index affc2c50b..6cc9cffde 100644 --- a/dembrane/frontend/src/locales/cs-CZ.po +++ b/dembrane/frontend/src/locales/cs-CZ.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} deleted" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "{0} souborů se nepodařilo nahrát. Zkuste to znovu." @@ -1555,7 +1555,7 @@ msgstr "Před uložením přidejte cíl projektu." msgid "Add a subject" msgstr "Přidejte předmět" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Add all that apply" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "All" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Všech {0} souborů bylo úspěšně nahráno" @@ -2753,7 +2753,7 @@ msgstr "Back" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Back" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Pokračovat" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Pokračovat" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continue" @@ -6651,7 +6651,7 @@ msgstr "Máte svou odpověď?" msgid "Grant licenses" msgstr "Udělit licence" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Skupina 1, Stůl 3 atd." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Zatím žádná plátna. Až budete chtít živý přehled rozhovorů, požádejte v chatu. První plátno zůstane tady." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Pro aktuální jazyk a sekci není k dispozici žádná karta." @@ -10351,8 +10351,8 @@ msgstr "Placený tarif" msgid "partially completed" msgstr "částečně dokončeno" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Participant" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Připraveno v" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Připraveni začít?" @@ -13146,7 +13146,7 @@ msgstr "Samostatný (klient)" msgid "Separate with commas, spaces, or new lines." msgstr "Separate with commas, spaces, or new lines." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Název setkání" @@ -14419,7 +14419,7 @@ msgstr "Štítek {0}" msgid "Tag deleted" msgstr "Tag deleted" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/de-DE.po b/dembrane/frontend/src/locales/de-DE.po index 76a69dd6e..68da00dd0 100644 --- a/dembrane/frontend/src/locales/de-DE.po +++ b/dembrane/frontend/src/locales/de-DE.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} gelöscht" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "{0} Datei(en) konnten nicht hochgeladen werden. Versuche es erneut." @@ -1555,7 +1555,7 @@ msgstr "Vor dem Speichern ein Projektziel angeben." msgid "Add a subject" msgstr "Betreff hinzufügen" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Alle zutreffenden hinzufügen" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "Alle" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Alle {0} Datei(en) erfolgreich hochgeladen" @@ -2753,7 +2753,7 @@ msgstr "Zurück" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Zurück" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Weiter" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Weiter" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Weiter" @@ -6651,7 +6651,7 @@ msgstr "Haben Sie Ihre Antwort?" msgid "Grant licenses" msgstr "Lizenzen vergeben" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Gruppe 1, Tisch 3 usw." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Noch keine Canvases. Frage im Chat, wenn du eine Live-Ansicht der Gespräche wünschst. Das erste Canvas bleibt hier." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Für die aktuelle Sprache und den aktuellen Abschnitt ist keine Karte verfügbar." @@ -10351,8 +10351,8 @@ msgstr "Kostenpflichtiger Tarif" msgid "partially completed" msgstr "teilweise abgeschlossen" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Teilnehmer" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Bereit um" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Bereit zum Start?" @@ -13146,7 +13146,7 @@ msgstr "Separat (Kunde)" msgid "Separate with commas, spaces, or new lines." msgstr "Mit Kommas, Leerzeichen oder Zeilenumbrüchen trennen." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Sitzungsname" @@ -14419,7 +14419,7 @@ msgstr "Tag {0}" msgid "Tag deleted" msgstr "Tag gelöscht" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/en-US.po b/dembrane/frontend/src/locales/en-US.po index 49801745b..d6ecbb12a 100644 --- a/dembrane/frontend/src/locales/en-US.po +++ b/dembrane/frontend/src/locales/en-US.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} deleted" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "{0} file(s) failed to upload. Try those again." @@ -1555,7 +1555,7 @@ msgstr "Add a project goal before saving." msgid "Add a subject" msgstr "Add a subject" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Add all that apply" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "All" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "All {0} file(s) uploaded successfully" @@ -2753,7 +2753,7 @@ msgstr "Back" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Back" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Continue" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Continue" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continue" @@ -6651,7 +6651,7 @@ msgstr "Got your answer?" msgid "Grant licenses" msgstr "Grant licenses" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Group 1, Table 3, etc." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "No canvases yet. Ask in chat when you want a live view of the conversations. The first canvas will stay here." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "No card available for the current language and section." @@ -10351,8 +10351,8 @@ msgstr "Paid plan" msgid "partially completed" msgstr "partially completed" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Participant" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Ready by" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Ready to begin?" @@ -13146,7 +13146,7 @@ msgstr "Separate (client)" msgid "Separate with commas, spaces, or new lines." msgstr "Separate with commas, spaces, or new lines." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Session name" @@ -14419,7 +14419,7 @@ msgstr "Tag {0}" msgid "Tag deleted" msgstr "Tag deleted" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/es-ES.po b/dembrane/frontend/src/locales/es-ES.po index 4b2ed4861..d097792d0 100644 --- a/dembrane/frontend/src/locales/es-ES.po +++ b/dembrane/frontend/src/locales/es-ES.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} eliminadas" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "Error al subir {0} archivo(s). Vuelve a intentarlo." @@ -1555,7 +1555,7 @@ msgstr "Añade un objetivo al proyecto antes de guardar." msgid "Add a subject" msgstr "Añade un asunto" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Añade todos los que correspondan" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "Todo" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Los {0} archivo(s) se subieron correctamente" @@ -2753,7 +2753,7 @@ msgstr "Atrás" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Volver" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Continuar" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Continuar" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continuar" @@ -6651,7 +6651,7 @@ msgstr "¿Tienes tu respuesta?" msgid "Grant licenses" msgstr "Otorgar licencias" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Grupo 1, Mesa 3, etc." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Aún no hay lienzos. Pídelo por el chat cuando quieras una vista en directo de las conversaciones. El primer lienzo se quedará aquí." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "No hay ninguna tarjeta disponible para el idioma y la sección actuales." @@ -10351,8 +10351,8 @@ msgstr "Plan de pago" msgid "partially completed" msgstr "completado parcialmente" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Participante" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Listo a las" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "¿Listo para empezar?" @@ -13146,7 +13146,7 @@ msgstr "Independiente (cliente)" msgid "Separate with commas, spaces, or new lines." msgstr "Separa con comas, espacios o saltos de línea." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Nombre de la sesión" @@ -14419,7 +14419,7 @@ msgstr "Etiqueta {0}" msgid "Tag deleted" msgstr "Etiqueta eliminada" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/fr-FR.po b/dembrane/frontend/src/locales/fr-FR.po index 9c0272d1f..065eb018d 100644 --- a/dembrane/frontend/src/locales/fr-FR.po +++ b/dembrane/frontend/src/locales/fr-FR.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} supprimé(s)" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "Échec de l'importation de {0} fichier(s). Veuillez réessayer." @@ -1555,7 +1555,7 @@ msgstr "Ajoutez un objectif de projet avant d'enregistrer." msgid "Add a subject" msgstr "Ajoutez un sujet" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Ajouter tout ce qui s'applique" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "Tout" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Les {0} fichier(s) ont bien été importés" @@ -2753,7 +2753,7 @@ msgstr "Retour" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Retour" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Continuer" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Continuer" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continuer" @@ -6651,7 +6651,7 @@ msgstr "Avez-vous obtenu votre réponse ?" msgid "Grant licenses" msgstr "Attribuer des licences" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Groupe 1, Table 3, etc." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Aucun canevas pour l'instant. Demandez dans le chat lorsque vous souhaitez une vue en direct des conversations. Le premier canevas restera ici." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Aucune fiche disponible pour la langue et la section actuelles." @@ -10351,8 +10351,8 @@ msgstr "Forfait payant" msgid "partially completed" msgstr "partiellement terminé" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Participant" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Prêt à" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Prêt à commencer ?" @@ -13146,7 +13146,7 @@ msgstr "Séparé (client)" msgid "Separate with commas, spaces, or new lines." msgstr "Séparez par des virgules, des espaces ou des retours à la ligne." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Nom de la séance" @@ -14419,7 +14419,7 @@ msgstr "Étiquette {0}" msgid "Tag deleted" msgstr "Étiquette supprimée" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/it-IT.po b/dembrane/frontend/src/locales/it-IT.po index 6e4dd0106..ed81d77ca 100644 --- a/dembrane/frontend/src/locales/it-IT.po +++ b/dembrane/frontend/src/locales/it-IT.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} eliminati" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "Impossibile caricare {0} file. Riprova." @@ -1555,7 +1555,7 @@ msgstr "Aggiungi un obiettivo del progetto prima di salvare." msgid "Add a subject" msgstr "Aggiungi un oggetto" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Seleziona tutte le opzioni pertinenti" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "All" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Tutti i {0} file caricati con successo" @@ -2753,7 +2753,7 @@ msgstr "Back" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Indietro" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Continua" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Continua" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continua" @@ -6651,7 +6651,7 @@ msgstr "Hai trovato la risposta?" msgid "Grant licenses" msgstr "Assegna licenze" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Gruppo 1, Tavolo 3, ecc." @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Ancora nessun canvas. Chiedi in chat quando vuoi una panoramica in tempo reale delle conversazioni. Il primo canvas rimarrà qui." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Nessuna scheda disponibile per la lingua e la sezione attuali." @@ -10351,8 +10351,8 @@ msgstr "Piano a pagamento" msgid "partially completed" msgstr "parzialmente completato" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Partecipante" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Pronto alle" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Pronto per iniziare?" @@ -13146,7 +13146,7 @@ msgstr "Separato (cliente)" msgid "Separate with commas, spaces, or new lines." msgstr "Separa con virgole, spazi o a capo." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Nome della sessione" @@ -14419,7 +14419,7 @@ msgstr "Tag {0}" msgid "Tag deleted" msgstr "Tag eliminato" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/nl-NL.po b/dembrane/frontend/src/locales/nl-NL.po index b47e51084..8084657fc 100644 --- a/dembrane/frontend/src/locales/nl-NL.po +++ b/dembrane/frontend/src/locales/nl-NL.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "{0} verwijderd" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "{0} bestand(en) uploaden mislukt. Probeer die opnieuw." @@ -1555,7 +1555,7 @@ msgstr "Voeg een projectdoel toe voordat je opslaat." msgid "Add a subject" msgstr "Voeg een onderwerp toe" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Vink aan wat van toepassing is" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "Alles" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Alle {0} bestand(en) succesvol geüpload" @@ -2750,7 +2750,7 @@ msgstr "Terug" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Terug" @@ -3964,12 +3964,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Doorgaan" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Doorgaan" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Doorgaan" @@ -6648,7 +6648,7 @@ msgstr "Antwoord gekregen?" msgid "Grant licenses" msgstr "Licenties toekennen" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Groep 1, Tafel 3, enz." @@ -8926,7 +8926,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Nog geen canvassen. Vraag het in de chat als je een live beeld van de gesprekken wilt. Het eerste canvas komt hier te staan." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Geen kaart beschikbaar voor de huidige taal en sectie." @@ -10348,8 +10348,8 @@ msgstr "Betaald abonnement" msgid "partially completed" msgstr "deels afgerond" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Deelnemer" @@ -11482,7 +11482,7 @@ msgid "Ready by" msgstr "Klaar om" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Klaar om te beginnen?" @@ -13143,7 +13143,7 @@ msgstr "Apart (klant)" msgid "Separate with commas, spaces, or new lines." msgstr "Scheid met komma's, spaties of nieuwe regels." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Sessienaam" @@ -14416,7 +14416,7 @@ msgstr "Tag {0}" msgid "Tag deleted" msgstr "Tag verwijderd" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/locales/uk-UA.po b/dembrane/frontend/src/locales/uk-UA.po index baf09ec23..314f9bb5a 100644 --- a/dembrane/frontend/src/locales/uk-UA.po +++ b/dembrane/frontend/src/locales/uk-UA.po @@ -409,7 +409,7 @@ msgid "{0} deleted" msgstr "Видалено: {0}" #. placeholder {0}: failed.length -#: src/lib/api.ts:687 +#: src/lib/api.ts:694 msgid "{0} file(s) failed to upload. Try those again." msgstr "Не вдалося завантажити {0} файл(ів). Спробуйте ще раз." @@ -1555,7 +1555,7 @@ msgstr "Додайте мету проєкту перед збереженням msgid "Add a subject" msgstr "Додайте тему" -#: src/portal/components/start/ParticipantInitiateForm.tsx:308 +#: src/portal/components/start/ParticipantInitiateForm.tsx:316 msgid "Add all that apply" msgstr "Add all that apply" @@ -1905,7 +1905,7 @@ msgid "All" msgstr "All" #. placeholder {0}: payload.chunks.length -#: src/lib/api.ts:817 +#: src/lib/api.ts:824 msgid "All {0} file(s) uploaded successfully" msgstr "Усі файли ({0}) успішно завантажено" @@ -2753,7 +2753,7 @@ msgstr "Back" #. js-lingui-explicit-id #: src/portal/layout/ParticipantHeader.tsx:94 -#: src/portal/components/start/ParticipantOnboardingCards.tsx:438 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:463 msgid "participant.button.back" msgstr "Back" @@ -3967,12 +3967,12 @@ msgid "participant.verify.instructions.button.next" msgstr "Продовжити" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:456 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:481 msgid "participant.button.next" msgstr "Продовжити" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantInitiateForm.tsx:345 +#: src/portal/components/start/ParticipantInitiateForm.tsx:353 msgid "participant.ready.to.begin.button.text" msgstr "Continue" @@ -6651,7 +6651,7 @@ msgstr "Отримали відповідь?" msgid "Grant licenses" msgstr "Надати ліцензії" -#: src/portal/components/start/ParticipantInitiateForm.tsx:297 +#: src/portal/components/start/ParticipantInitiateForm.tsx:305 msgid "Group 1, Table 3, etc." msgstr "Група 1, Стіл 3 тощо" @@ -8929,7 +8929,7 @@ msgid "No canvases yet. Ask in chat when you want a live view of the conversatio msgstr "Полотен ще немає. Запитайте в чаті, коли захочете переглянути розмови наживо. Перше полотно залишиться тут." #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:286 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:301 msgid "participant.onboarding.no.card" msgstr "Для поточної мови та розділу немає картки." @@ -10351,8 +10351,8 @@ msgstr "Платний тариф" msgid "partially completed" msgstr "завершено частково" -#: src/portal/components/start/ParticipantInitiateForm.tsx:136 -#: src/portal/components/start/ParticipantInitiateForm.tsx:197 +#: src/portal/components/start/ParticipantInitiateForm.tsx:142 +#: src/portal/components/start/ParticipantInitiateForm.tsx:204 #: src/components/report/ConversationStatusTable.tsx:56 msgid "Participant" msgstr "Participant" @@ -11485,7 +11485,7 @@ msgid "Ready by" msgstr "Готово о" #. js-lingui-explicit-id -#: src/portal/components/start/ParticipantOnboardingCards.tsx:346 +#: src/portal/components/start/ParticipantOnboardingCards.tsx:371 msgid "participant.ready.to.begin" msgstr "Готові почати?" @@ -13146,7 +13146,7 @@ msgstr "Окремий (клієнт)" msgid "Separate with commas, spaces, or new lines." msgstr "Розділяйте комами, пробілами або новими рядками." -#: src/portal/components/start/ParticipantInitiateForm.tsx:291 +#: src/portal/components/start/ParticipantInitiateForm.tsx:299 msgid "Session name" msgstr "Назва сесії" @@ -14419,7 +14419,7 @@ msgstr "Тег {0}" msgid "Tag deleted" msgstr "Тег видалено" -#: src/portal/components/start/ParticipantInitiateForm.tsx:307 +#: src/portal/components/start/ParticipantInitiateForm.tsx:315 #: src/components/project/ProjectTagsInput.tsx:281 #: src/components/map/panels/MapSettingsMenu.tsx:267 #: src/components/conversation/ProjectConversationsPanel.tsx:732 diff --git a/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.test.tsx b/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.test.tsx index ebaa5e3f3..bf19d2df0 100644 --- a/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.test.tsx +++ b/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.test.tsx @@ -2,7 +2,13 @@ import { i18n } from "@lingui/core"; import { I18nProvider } from "@lingui/react"; import { MantineProvider } from "@mantine/core"; -import { cleanup, render, screen, waitFor } from "@testing-library/react"; +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from "@testing-library/react"; import { MemoryRouter } from "react-router"; import { afterEach, beforeAll, expect, it, vi } from "vitest"; import { @@ -12,6 +18,7 @@ import { const navigate = vi.fn(); const initiate = vi.fn(); +const mutate = vi.fn(); vi.mock("posthog-js", () => ({ default: { capture: () => {} }, @@ -34,7 +41,7 @@ vi.mock("@/portal/components/start/useInitiateConversationMutation", () => ({ isError: mutationError !== null, isPending: false, isSuccess: false, - mutate: () => {}, + mutate: (...args: unknown[]) => mutate(...args), }), })); @@ -67,6 +74,7 @@ afterEach(() => { mutationError = null; navigate.mockClear(); initiate.mockClear(); + mutate.mockClear(); }); const project = (overrides: Partial = {}) => @@ -275,3 +283,51 @@ it("tells its parent when the start is refused", () => { expect(onRefusedChange).toHaveBeenLastCalledWith(true); }); + +it("forwards consent on auto-start", async () => { + initiate.mockResolvedValue({ id: "c1" }); + const consent = { accepted: true, version: "2026-11-30" }; + render( + + + + + + + , + ); + + await waitFor(() => expect(initiate).toHaveBeenCalledTimes(1)); + expect(initiate).toHaveBeenCalledWith( + expect.objectContaining({ consent, projectId: "p1" }), + ); +}); + +it("forwards consent on manual submit", async () => { + const consent = { accepted: true, version: "2026-11-30" }; + render( + + + + + + + , + ); + + fireEvent.change(screen.getByTestId("portal-initiate-name-input"), { + target: { value: "Table 1" }, + }); + fireEvent.click(screen.getByTestId("portal-initiate-next-button")); + + await waitFor(() => expect(mutate).toHaveBeenCalledTimes(1)); + expect(mutate).toHaveBeenCalledWith( + expect.objectContaining({ consent, projectId: "p1" }), + expect.anything(), + ); +}); diff --git a/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.tsx b/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.tsx index 4e4322a8a..68fb963b1 100644 --- a/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.tsx +++ b/dembrane/frontend/src/portal/components/start/ParticipantInitiateForm.tsx @@ -17,7 +17,10 @@ import { useSearchParams } from "react-router"; import { z } from "zod"; import { ErrorNotice } from "@/components/error/ErrorNotice"; import { useI18nNavigate } from "@/hooks/useI18nNavigate"; -import { initiateConversation as requestConversation } from "@/lib/api"; +import { + type InitiateConsentPayload, + initiateConversation as requestConversation, +} from "@/lib/api"; import { portalRecordingRefusal } from "@/lib/freeTier"; import { testId } from "@/lib/testUtils"; import { getVisitorId } from "@/lib/visitorId"; @@ -54,9 +57,11 @@ const autoStartedConversations = new Map< export const ParticipantInitiateForm = ({ project, + consent, onRefusedChange, }: { project: Project; + consent?: InitiateConsentPayload; onRefusedChange?: (refused: boolean) => void; }) => { const navigate = useI18nNavigate(); @@ -130,6 +135,7 @@ export const ParticipantInitiateForm = ({ }); initiateConversation( { + consent, email: data.email || undefined, // `??` not `||`: an empty name is intentional when the project does // not ask for one, and keeps the dashboard's auto-title fallback @@ -147,7 +153,7 @@ export const ParticipantInitiateForm = ({ }, ); }, - [project.id, initiateConversation, portalSource], + [consent, project.id, initiateConversation, portalSource], ); const nothingToAsk = portalHasNothingToAsk(project); @@ -193,6 +199,7 @@ export const ParticipantInitiateForm = ({ source: portalSource, }); pending = requestConversation({ + consent, email: defaultEmail || undefined, name: defaultName || t`Participant`, pin: "", @@ -223,6 +230,7 @@ export const ParticipantInitiateForm = ({ cancelled = true; }; }, [ + consent, project.default_conversation_ask_for_participant_name, project.id, nothingToAsk, diff --git a/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.test.tsx b/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.test.tsx index 3ce5425f1..2b2c4a94a 100644 --- a/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.test.tsx +++ b/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.test.tsx @@ -7,26 +7,47 @@ import { MemoryRouter } from "react-router"; import { afterEach, beforeAll, expect, it, vi } from "vitest"; import ParticipantOnboardingCards from "./ParticipantOnboardingCards"; +const systemCards = vi.hoisted(() => ({ + current: [ + { section: "Intro", slides: [{ content: "Hi", title: "Welcome" }] }, + ] as Array<{ + section: string; + slides: Array<{ + type?: string; + title: string; + content?: string; + checkbox?: { label: string; required: boolean }; + }>; + }>, +})); +const initiateProps = vi.hoisted(() => ({ + lastConsent: undefined as { accepted: boolean; version: string } | undefined, +})); + vi.mock("posthog-js", () => ({ default: { capture: () => {} } })); vi.mock("@/components/common/Logo", () => ({ Logo: () => null })); vi.mock("@/hooks/useLanguage", () => ({ useLanguage: () => ({ language: "en-US" }), })); vi.mock("./onboardingCards", () => ({ - getSystemCards: () => [ - { section: "Intro", slides: [{ content: "Hi", title: "Welcome" }] }, - ], + CONSENT_VERSION: "2026-11-30", + getSystemCards: () => systemCards.current, })); vi.mock("./ParticipantInitiateForm", () => ({ ParticipantInitiateForm: ({ + consent, onRefusedChange, }: { + consent?: { accepted: boolean; version: string }; onRefusedChange?: (refused: boolean) => void; - }) => ( - - ), + }) => { + initiateProps.lastConsent = consent; + return ( + + ); + }, portalHasNothingToAsk: () => false, })); @@ -47,7 +68,13 @@ beforeAll(() => { })); }); -afterEach(cleanup); +afterEach(() => { + cleanup(); + initiateProps.lastConsent = undefined; + systemCards.current = [ + { section: "Intro", slides: [{ content: "Hi", title: "Welcome" }] }, + ]; +}); const project = { id: "p1", @@ -80,8 +107,55 @@ it("drops the heading and Back once the start is refused", () => { it("drops the heading once the start is refused when onboarding is skipped", () => { wrap("/en-US/p1/start?skipOnboarding=1"); expect(screen.getByText("Ready to begin?")).toBeTruthy(); + expect(initiateProps.lastConsent).toBeUndefined(); fireEvent.click(screen.getByText("refuse")); expect(screen.queryByText("Ready to begin?")).toBeNull(); }); + +it("passes accepted consent after the participant checks and accepts the privacy card", () => { + systemCards.current = [ + { + section: "Privacy", + slides: [ + { + checkbox: { label: "I consent", required: true }, + content: "Privacy notice", + title: "Your privacy", + type: "privacy", + }, + ], + }, + ]; + wrap("/en-US/p1/start"); + fireEvent.click(screen.getByTestId("portal-onboarding-checkbox")); + fireEvent.click(screen.getByTestId("portal-onboarding-next-button")); + + expect(initiateProps.lastConsent).toEqual({ + accepted: true, + version: "2026-11-30", + }); +}); + +it("passes the card version but not acceptance after a non-checkbox privacy card", () => { + systemCards.current = [ + { + section: "Privacy", + slides: [ + { + content: "Organiser manages data", + title: "Privacy", + type: "privacy", + }, + ], + }, + ]; + wrap("/en-US/p1/start"); + fireEvent.click(screen.getByTestId("portal-onboarding-next-button")); + + expect(initiateProps.lastConsent).toEqual({ + accepted: false, + version: "2026-11-30", + }); +}); diff --git a/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.tsx b/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.tsx index 743ffdd83..75e6add94 100644 --- a/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.tsx +++ b/dembrane/frontend/src/portal/components/start/ParticipantOnboardingCards.tsx @@ -11,7 +11,7 @@ import { PARTICIPANT_BASE_URL } from "@/config"; import { useLanguage } from "@/hooks/useLanguage"; import { testId } from "@/lib/testUtils"; import { cn } from "@/lib/utils"; -import { getSystemCards } from "./onboardingCards"; +import { CONSENT_VERSION, getSystemCards } from "./onboardingCards"; import { ParticipantInitiateForm, portalHasNothingToAsk, @@ -74,6 +74,8 @@ const ParticipantOnboardingCards = ({ const [checkboxStates, setCheckboxStates] = useState>( {}, ); + const [privacySeen, setPrivacySeen] = useState(false); + const [consentAccepted, setConsentAccepted] = useState(false); const [animationDirection, setAnimationDirection] = useState(""); // The form refused to start: nothing to begin and nowhere to go back to. const [refused, setRefused] = useState(false); @@ -105,11 +107,24 @@ const ParticipantOnboardingCards = ({ .filter(Boolean); }, [searchParams, project.tags]); + // Accepted only means a ticked checkbox; notice-only cards just record the version shown. + const consent = useMemo( + () => + privacySeen + ? { accepted: consentAccepted, version: CONSENT_VERSION } + : undefined, + [privacySeen, consentAccepted], + ); + const InitiateFormComponent = useMemo( () => () => ( - + ), - [project], + [project, consent], ); // With no name and no tags to collect, the last card starts the conversation @@ -301,6 +316,12 @@ const ParticipantOnboardingCards = ({ if (currentCard.checkbox?.required) { posthog.capture("consent_given", { project_id: project.id }); } + if (currentCard.type === "privacy") { + setPrivacySeen(true); + setConsentAccepted( + Boolean(currentCard.checkbox && checkboxStates[`${currentSlideIndex}`]), + ); + } if (currentSlideIndex < allSlides.length - 1) { setAnimationDirection("slide-left"); setCurrentSlideIndex((prev) => prev + 1); @@ -317,10 +338,14 @@ const ParticipantOnboardingCards = ({ }; const handleCheckboxChange = (event: React.ChangeEvent) => { + const checked = event.target.checked; setCheckboxStates((prev) => ({ ...prev, - [`${currentSlideIndex}`]: event.target.checked, + [`${currentSlideIndex}`]: checked, })); + if (currentCard.type === "privacy" && !checked) { + setConsentAccepted(false); + } }; return ( diff --git a/dembrane/frontend/src/portal/components/start/onboardingCards.consentVersion.test.ts b/dembrane/frontend/src/portal/components/start/onboardingCards.consentVersion.test.ts new file mode 100644 index 000000000..c6dc1a029 --- /dev/null +++ b/dembrane/frontend/src/portal/components/start/onboardingCards.consentVersion.test.ts @@ -0,0 +1,49 @@ +import { createHash } from "node:crypto"; +import { describe, expect, it } from "vitest"; +import { CONSENT_VERSION, getSystemCards } from "./onboardingCards"; + +const LANGS = [ + "cs-CZ", + "de-DE", + "en-US", + "es-ES", + "fr-FR", + "it-IT", + "nl-NL", + "uk-UA", +]; +const BASES = ["client-managed", "consent", "dembrane-events"] as const; + +// The privacy card text each CONSENT_VERSION stands for. Change the wording and this +// fails: add a new CONSENT_VERSION with its hash, never edit an old entry. +const PRIVACY_CARD_HASHES: Record = { + "2026-11-30": + "cd687fb51b6b27223f87295a5fed87f346afe7aa871b9a563dd0025c623ceece", +}; + +const privacyCardText = () => + JSON.stringify( + LANGS.flatMap((lang) => + BASES.map((basis) => [ + lang, + basis, + getSystemCards( + lang, + "none", + basis, + "https://example.org/privacy", + "Host Org", + ), + ]), + ), + ); + +describe("CONSENT_VERSION", () => { + it("matches the privacy card wording it was recorded for", () => { + const hash = createHash("sha256").update(privacyCardText()).digest("hex"); + expect( + PRIVACY_CARD_HASHES[CONSENT_VERSION], + `Privacy card text changed (sha256 ${hash}). Bump CONSENT_VERSION and add it here.`, + ).toBe(hash); + }); +}); diff --git a/dembrane/frontend/src/portal/components/start/onboardingCards.ts b/dembrane/frontend/src/portal/components/start/onboardingCards.ts index ca9a74452..e865795b1 100644 --- a/dembrane/frontend/src/portal/components/start/onboardingCards.ts +++ b/dembrane/frontend/src/portal/components/start/onboardingCards.ts @@ -1194,6 +1194,9 @@ const getAdvancedTutorialCards = ( return tutorialCards[lang] || tutorialCards["en-US"] || []; }; +/** Bumped whenever the recording privacy card wording changes; stored on each conversation. */ +export const CONSENT_VERSION = "2026-11-30"; + const getPrivacyCard = ( lang: string, legalBasis: LegalBasis = "client-managed", diff --git a/dembrane/platform/packages/conversations/src/portal/routes.ts b/dembrane/platform/packages/conversations/src/portal/routes.ts index 6e8dc830f..181d40d86 100644 --- a/dembrane/platform/packages/conversations/src/portal/routes.ts +++ b/dembrane/platform/packages/conversations/src/portal/routes.ts @@ -21,9 +21,14 @@ import { } from "./service"; import { confirmUpload, probeUrl, uploadUrl } from "./uploads"; -const { model, optional, required, nullable, str, list, datetime } = p; +const { model, nested, optional, required, nullable, str, bool, list, datetime } = p; -const InitiateBody = model({ +const InitiateConsentBody = model({ + accepted: required(bool()), + version: required(str({ min: 1, max: 32 })), +}); + +export const InitiateBody = model({ name: required(str()), pin: required(str()), conversation_id: optional(nullable(str()), null), @@ -32,6 +37,7 @@ const InitiateBody = model({ tag_id_list: optional(nullable(list(str())), [] as string[]), source: optional(nullable(str()), null), visitor_id: optional(nullable(str()), null), + consent: optional(nullable(nested(InitiateConsentBody)), null), }); const UploadTextBody = model({ @@ -74,6 +80,7 @@ export function portalRoutes(d: ConversationsDeps) { userAgent: b.user_agent, tagIds: b.tag_id_list ?? [], source: b.source, + consent: b.consent, }); const live = liveServices(d); // The funnel dot this conversation grew out of leaves the monitor's lanes at once. diff --git a/dembrane/platform/packages/conversations/src/portal/service.ts b/dembrane/platform/packages/conversations/src/portal/service.ts index b6a802be5..199b7802a 100644 --- a/dembrane/platform/packages/conversations/src/portal/service.ts +++ b/dembrane/platform/packages/conversations/src/portal/service.ts @@ -51,12 +51,37 @@ export function publicChunk(c: ChunkRow) { }; } +export interface InitiateConsentInput { + readonly accepted: boolean; + readonly version: string; +} + export interface InitiateInput { readonly name: string; readonly email: string | null; readonly userAgent: string | null; readonly tagIds: readonly string[]; readonly source: string | null; + readonly consent?: InitiateConsentInput | null; +} + +/** + * The three recording-consent columns stamped at initiate. The basis is always the server's. + * The version is the privacy card the participant saw; only a consent basis has a checkbox, + * so accepted is recorded for that basis alone. + */ +export function resolveConsentColumns( + legalBasis: string, + consent: InitiateConsentInput | null | undefined, + now: string, +) { + const version = consent ? clip(consent.version, 32) : ""; + const accepted = legalBasis === "consent" && consent?.accepted === true && Boolean(version); + return { + consent_basis: clip(legalBasis, 32), + consent_accepted_at: accepted ? now : null, + consent_version: version || null, + }; } /** @@ -73,8 +98,15 @@ export async function initiate(d: PortalDeps, projectId: string, input: Initiate // Anything but typed text may record, so it is a start; typed text only needs AI. if (input.source !== "PORTAL_TEXT") await requireAudioStart(d, project.id); else await requireTextStart(d, project.id); + const legal = project.legal_basis + ? effectiveLegalBasis({ project }) + : effectiveLegalBasis({ + project, + ...(await portalStore(d.db).cascade(project.workspace_id, project.directus_user_id)), + }); const id = newId(); const now = d.now().toISOString(); + const consentCols = resolveConsentColumns(legal.legal_basis, input.consent, now); const row = await transaction(d.db, async (tx) => { const [created] = await tx.db .insert(conversation) @@ -87,6 +119,7 @@ export async function initiate(d: PortalDeps, projectId: string, input: Initiate participant_user_agent: input.userAgent && clip(input.userAgent, 255), source: input.source, is_anonymized: Boolean(project.anonymize_transcripts), + ...consentCols, created_at: now, updated_at: now, }) diff --git a/dembrane/platform/packages/conversations/test/portal-units.test.ts b/dembrane/platform/packages/conversations/test/portal-units.test.ts index f772973b4..837712612 100644 --- a/dembrane/platform/packages/conversations/test/portal-units.test.ts +++ b/dembrane/platform/packages/conversations/test/portal-units.test.ts @@ -1,7 +1,10 @@ import { expect, test } from "bun:test"; import { ForbiddenError, UnauthenticatedError } from "@dembrane/core"; +import type { Issue } from "@dembrane/legacy-shape"; import { AudioUrls, sanitizeFilenameComponent, uploadKeyName } from "../src/audio-urls"; import { ParticipantTokens } from "../src/participant-token"; +import { InitiateBody } from "../src/portal/routes"; +import { resolveConsentColumns } from "../src/portal/service"; const C = "c1000000-0000-4000-8000-000000000001"; const P = "f0000000-0000-4000-8000-000000000001"; @@ -75,3 +78,68 @@ test("an upload's key name is short and safe and keeps the extension", () => { expect(long.length).toBeLessThanOrEqual(84); expect(long.endsWith("ab.m4a")).toBe(true); }); + +test("InitiateBody accepts optional consent and enforces max 32 chars on consent.version", () => { + const withoutIssues: Issue[] = []; + const without = InitiateBody.parse({ name: "P", pin: "" }, ["body"], withoutIssues); + expect(withoutIssues).toEqual([]); + expect(without).toMatchObject({ data: { consent: null } }); + + const withIssues: Issue[] = []; + const accepted = InitiateBody.parse( + { name: "P", pin: "", consent: { accepted: true, version: "2026-11-30" } }, + ["body"], + withIssues, + ); + expect(withIssues).toEqual([]); + expect(accepted).toMatchObject({ + data: { consent: { accepted: true, version: "2026-11-30" } }, + }); + + const tooLongIssues: Issue[] = []; + InitiateBody.parse( + { name: "P", pin: "", consent: { accepted: true, version: "v".repeat(33) } }, + ["body"], + tooLongIssues, + ); + expect(tooLongIssues).toHaveLength(1); + expect(tooLongIssues[0]?.type).toBe("string_too_long"); + + const emptyIssues: Issue[] = []; + InitiateBody.parse( + { name: "P", pin: "", consent: { accepted: true, version: "" } }, + ["body"], + emptyIssues, + ); + expect(emptyIssues).toHaveLength(1); + expect(emptyIssues[0]?.type).toBe("string_too_short"); +}); + +test("resolveConsentColumns: basis from the server, version when a card was shown, accepted only on a consent basis", () => { + const now = "2026-11-30T12:00:00.000Z"; + const v = "2026-11-30"; + expect(resolveConsentColumns("consent", { accepted: true, version: v }, now)).toEqual({ + consent_basis: "consent", + consent_accepted_at: now, + consent_version: v, + }); + // Older clients send nothing: only the basis. + for (const basis of ["client-managed", "dembrane-events", "consent"]) + expect(resolveConsentColumns(basis, null, now)).toEqual({ + consent_basis: basis, + consent_accepted_at: null, + consent_version: null, + }); + // Notice-only cards have no checkbox, so a claimed acceptance is not recorded. + for (const basis of ["client-managed", "dembrane-events"]) + expect(resolveConsentColumns(basis, { accepted: true, version: v }, now)).toEqual({ + consent_basis: basis, + consent_accepted_at: null, + consent_version: v, + }); + expect(resolveConsentColumns("consent", { accepted: false, version: v }, now)).toEqual({ + consent_basis: "consent", + consent_accepted_at: null, + consent_version: v, + }); +}); diff --git a/dembrane/platform/packages/conversations/test/portal.integration.test.ts b/dembrane/platform/packages/conversations/test/portal.integration.test.ts index 6d2865d34..8f97cebca 100644 --- a/dembrane/platform/packages/conversations/test/portal.integration.test.ts +++ b/dembrane/platform/packages/conversations/test/portal.integration.test.ts @@ -139,6 +139,76 @@ run("portal uploads and audio routes", () => { expect(links.map((l) => l.project_tag_id)).toEqual([tag]); }); + test("initiate stamps recording consent columns from server legal basis and accepted consent payload", async () => { + await seed(sql, newId()); + await sql`update project set legal_basis = 'consent' where id = ${PROJECT}`; + try { + const withConsent = await post( + `/api/participant/projects/${PROJECT}/conversations/initiate`, + { + name: "Consented", + pin: "", + consent: { accepted: true, version: "2026-11-30", basis: "spoofed" }, + }, + ); + expect(withConsent.status).toBe(200); + const { id: acceptedId } = (await withConsent.json()) as { id: string }; + const [acceptedRow] = await sql` + select consent_accepted_at, consent_version, consent_basis + from conversation + where id = ${acceptedId} + `; + expect(acceptedRow?.consent_basis).toBe("consent"); + expect(acceptedRow?.consent_version).toBe("2026-11-30"); + expect(acceptedRow?.consent_accepted_at).not.toBeNull(); + + const tooLong = await post(`/api/participant/projects/${PROJECT}/conversations/initiate`, { + name: "Overlong", + pin: "", + consent: { accepted: true, version: "x".repeat(33) }, + }); + expect(tooLong.status).toBe(422); + } finally { + await sql`update project set legal_basis = null where id = ${PROJECT}`; + } + + // Without consent (e.g. older dembrane-go clients): backward-compatible, basis still stamped. + const withoutConsent = await post( + `/api/participant/projects/${PROJECT}/conversations/initiate`, + { + name: "LegacyClient", + pin: "", + }, + ); + expect(withoutConsent.status).toBe(200); + const { id: legacyId } = (await withoutConsent.json()) as { id: string }; + const [legacyRow] = await sql` + select consent_accepted_at, consent_version, consent_basis + from conversation + where id = ${legacyId} + `; + expect(legacyRow?.consent_basis).toBe("client-managed"); + expect(legacyRow?.consent_accepted_at).toBeNull(); + expect(legacyRow?.consent_version).toBeNull(); + + // A notice-only card has no checkbox: the card version is kept, acceptance never is. + const noticeOnly = await post(`/api/participant/projects/${PROJECT}/conversations/initiate`, { + name: "NoticeOnly", + pin: "", + consent: { accepted: true, version: "2026-11-30" }, + }); + expect(noticeOnly.status).toBe(200); + const { id: noticeId } = (await noticeOnly.json()) as { id: string }; + const [noticeRow] = await sql` + select consent_accepted_at, consent_version, consent_basis + from conversation + where id = ${noticeId} + `; + expect(noticeRow?.consent_basis).toBe("client-managed"); + expect(noticeRow?.consent_version).toBe("2026-11-30"); + expect(noticeRow?.consent_accepted_at).toBeNull(); + }); + test("replies: oldest first, only through the conversation's own project", async () => { const conv = newId(); await seed(sql, conv); diff --git a/dembrane/platform/packages/db/migrations/0065_expand_conversation_consent.sql b/dembrane/platform/packages/db/migrations/0065_expand_conversation_consent.sql new file mode 100644 index 000000000..f71b64153 --- /dev/null +++ b/dembrane/platform/packages/db/migrations/0065_expand_conversation_consent.sql @@ -0,0 +1,6 @@ +-- Recording consent provenance stamped by the server at conversation initiate. Safe to run twice. +-- Nullable columns rewrite no rows; one statement avoids taking multiple locks on a hot table. +ALTER TABLE "conversation" + ADD COLUMN IF NOT EXISTS "consent_accepted_at" timestamp with time zone, + ADD COLUMN IF NOT EXISTS "consent_version" varchar(32), + ADD COLUMN IF NOT EXISTS "consent_basis" varchar(32); diff --git a/dembrane/platform/packages/db/migrations/meta/0065_snapshot.json b/dembrane/platform/packages/db/migrations/meta/0065_snapshot.json new file mode 100644 index 000000000..1a1bb7235 --- /dev/null +++ b/dembrane/platform/packages/db/migrations/meta/0065_snapshot.json @@ -0,0 +1,18179 @@ +{ + "id": "5275a68f-c160-4fb6-940a-d7a1b1c44051", + "prevId": "0167b889-835c-4294-a91e-ecad65f08e35", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.access_request": { + "name": "access_request", + "schema": "", + "columns": { + "actioned_at": { + "name": "actioned_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "actioned_by": { + "name": "actioned_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "requested_at": { + "name": "requested_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "access_request_actioned_by_foreign": { + "name": "access_request_actioned_by_foreign", + "tableFrom": "access_request", + "tableTo": "app_user", + "columnsFrom": [ + "actioned_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "access_request_user_id_foreign": { + "name": "access_request_user_id_foreign", + "tableFrom": "access_request", + "tableTo": "app_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "access_request_workspace_id_foreign": { + "name": "access_request_workspace_id_foreign", + "tableFrom": "access_request", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_audit_event": { + "name": "agent_audit_event", + "schema": "", + "columns": { + "app_user_id": { + "name": "app_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "duration_ms": { + "name": "duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "grant_id": { + "name": "grant_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "params": { + "name": "params", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "tool": { + "name": "tool", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": { + "agent_audit_event_app_user_id_index": { + "name": "agent_audit_event_app_user_id_index", + "columns": [ + { + "expression": "app_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_audit_event_client_id_index": { + "name": "agent_audit_event_client_id_index", + "columns": [ + { + "expression": "client_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_audit_event_created_at_index": { + "name": "agent_audit_event_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_audit_event_grant_id_index": { + "name": "agent_audit_event_grant_id_index", + "columns": [ + { + "expression": "grant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_audit_event_org_id_index": { + "name": "agent_audit_event_org_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_audit_event_tool_index": { + "name": "agent_audit_event_tool_index", + "columns": [ + { + "expression": "tool", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_client": { + "name": "agent_client", + "schema": "", + "columns": { + "client_name": { + "name": "client_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "client_secret_encrypted": { + "name": "client_secret_encrypted", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "redirect_uris": { + "name": "redirect_uris", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "token_endpoint_auth_method": { + "name": "token_endpoint_auth_method", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_grant": { + "name": "agent_grant", + "schema": "", + "columns": { + "app_user_id": { + "name": "app_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "client_id": { + "name": "client_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "client_name": { + "name": "client_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "consent_accepted_at": { + "name": "consent_accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "consent_version": { + "name": "consent_version", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "last_used_at": { + "name": "last_used_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "org_ids": { + "name": "org_ids", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "scopes": { + "name": "scopes", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "agent_grant_app_user_id_index": { + "name": "agent_grant_app_user_id_index", + "columns": [ + { + "expression": "app_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_grant_client_id_index": { + "name": "agent_grant_client_id_index", + "columns": [ + { + "expression": "client_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_grant_directus_user_id_index": { + "name": "agent_grant_directus_user_id_index", + "columns": [ + { + "expression": "directus_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_grant_expires_at_index": { + "name": "agent_grant_expires_at_index", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_grant_revoked_at_index": { + "name": "agent_grant_revoked_at_index", + "columns": [ + { + "expression": "revoked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_insight": { + "name": "agent_insight", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "suggested_capability": { + "name": "suggested_capability", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "chat_id": { + "name": "chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "message_id": { + "name": "message_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'new'" + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_loop": { + "name": "agent_loop", + "schema": "", + "columns": { + "acting_directus_user_id": { + "name": "acting_directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "cadence_minutes": { + "name": "cadence_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 5 + }, + "caps": { + "name": "caps", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "chat_id": { + "name": "chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_from_chat_id": { + "name": "created_from_chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "failure_count": { + "name": "failure_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "report_id": { + "name": "report_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'active'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "popcorn_state": { + "name": "popcorn_state", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "agent_loop_project_id_foreign": { + "name": "agent_loop_project_id_foreign", + "tableFrom": "agent_loop", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_loop_report_id_foreign": { + "name": "agent_loop_report_id_foreign", + "tableFrom": "agent_loop", + "tableTo": "project_report", + "columnsFrom": [ + "report_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_loop_run": { + "name": "agent_loop_run", + "schema": "", + "columns": { + "detail": { + "name": "detail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "free_period_start": { + "name": "free_period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "free_account_id": { + "name": "free_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "generation_id": { + "name": "generation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "loop_id": { + "name": "loop_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "agent_loop_run_running_started": { + "name": "agent_loop_run_running_started", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'running'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_loop_run_loop_started": { + "name": "agent_loop_run_loop_started", + "columns": [ + { + "expression": "loop_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "agent_loop_run_generation_id_foreign": { + "name": "agent_loop_run_generation_id_foreign", + "tableFrom": "agent_loop_run", + "tableTo": "canvas_generation", + "columnsFrom": [ + "generation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "agent_loop_run_loop_id_foreign": { + "name": "agent_loop_run_loop_id_foreign", + "tableFrom": "agent_loop_run", + "tableTo": "agent_loop", + "columnsFrom": [ + "loop_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_memory": { + "name": "agent_memory", + "schema": "", + "columns": { + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "memory_key": { + "name": "memory_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "scope": { + "name": "scope", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'project'" + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'agent'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.agent_token": { + "name": "agent_token", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "grant_id": { + "name": "grant_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "pair_id": { + "name": "pair_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "revoked_at": { + "name": "revoked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "token_hash": { + "name": "token_hash", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": { + "agent_token_expires_at_index": { + "name": "agent_token_expires_at_index", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_token_grant_id_index": { + "name": "agent_token_grant_id_index", + "columns": [ + { + "expression": "grant_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_token_pair_id_index": { + "name": "agent_token_pair_id_index", + "columns": [ + { + "expression": "pair_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_token_revoked_at_index": { + "name": "agent_token_revoked_at_index", + "columns": [ + { + "expression": "revoked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "agent_token_token_hash_index": { + "name": "agent_token_token_hash_index", + "columns": [ + { + "expression": "token_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "agent_token_token_hash_unique": { + "name": "agent_token_token_hash_unique", + "nullsNotDistinct": false, + "columns": [ + "token_hash" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.analysis_feedback": { + "name": "analysis_feedback", + "schema": "", + "columns": { + "actor_id": { + "name": "actor_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "object_id": { + "name": "object_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "rating": { + "name": "rating", + "type": "varchar(8)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "revision_id": { + "name": "revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "tags": { + "name": "tags", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "analysis_feedback_project_object_actor": { + "name": "analysis_feedback_project_object_actor", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "object_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_feedback_object_id_foreign": { + "name": "analysis_feedback_object_id_foreign", + "tableFrom": "analysis_feedback", + "tableTo": "analysis_object", + "columnsFrom": [ + "object_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_feedback_project_id_foreign": { + "name": "analysis_feedback_project_id_foreign", + "tableFrom": "analysis_feedback", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_feedback_revision_id_foreign": { + "name": "analysis_feedback_revision_id_foreign", + "tableFrom": "analysis_feedback", + "tableTo": "analysis_object_revision", + "columnsFrom": [ + "revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_feedback_actor_present": { + "name": "analysis_feedback_actor_present", + "value": "length(btrim((actor_id)::text)) > 0" + }, + "analysis_feedback_note_length": { + "name": "analysis_feedback_note_length", + "value": "(note IS NULL) OR (length(note) <= 500)" + }, + "analysis_feedback_rating_valid": { + "name": "analysis_feedback_rating_valid", + "value": "(rating)::text = ANY (ARRAY[('up'::character varying)::text, ('down'::character varying)::text])" + }, + "analysis_feedback_tags_are_an_array": { + "name": "analysis_feedback_tags_are_an_array", + "value": "json_typeof(tags) = 'array'::text" + } + }, + "isRLSEnabled": false + }, + "public.analysis_last_opened": { + "name": "analysis_last_opened", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "opened_at": { + "name": "opened_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": { + "analysis_last_opened_project_user": { + "name": "analysis_last_opened_project_user", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_last_opened_project_id_foreign": { + "name": "analysis_last_opened_project_id_foreign", + "tableFrom": "analysis_last_opened", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_last_opened_user_present": { + "name": "analysis_last_opened_user_present", + "value": "length(btrim((user_id)::text)) > 0" + } + }, + "isRLSEnabled": false + }, + "public.analysis_object": { + "name": "analysis_object", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "current_revision_id": { + "name": "current_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "lineage_key": { + "name": "lineage_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "revision_count": { + "name": "revision_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "analysis_object_project_lineage": { + "name": "analysis_object_project_lineage", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lineage_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_object_current_revision_id_foreign": { + "name": "analysis_object_current_revision_id_foreign", + "tableFrom": "analysis_object", + "tableTo": "analysis_object_revision", + "columnsFrom": [ + "current_revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_object_project_id_foreign": { + "name": "analysis_object_project_id_foreign", + "tableFrom": "analysis_object", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_object_scope_id_foreign": { + "name": "analysis_object_scope_id_foreign", + "tableFrom": "analysis_object", + "tableTo": "analysis_scope", + "columnsFrom": [ + "scope_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_object_revision_count_valid": { + "name": "analysis_object_revision_count_valid", + "value": "revision_count >= 0" + } + }, + "isRLSEnabled": false + }, + "public.analysis_object_revision": { + "name": "analysis_object_revision", + "schema": "", + "columns": { + "actor_id": { + "name": "actor_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "attributes": { + "name": "attributes", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "content_hash": { + "name": "content_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "embedding_refs": { + "name": "embedding_refs", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "hash_version": { + "name": "hash_version", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'c14n-v1'" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "object_id": { + "name": "object_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "parent_revision_id": { + "name": "parent_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payload": { + "name": "payload", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provenance": { + "name": "provenance", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "published_at": { + "name": "published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reason": { + "name": "reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "revision_number": { + "name": "revision_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "schema_version": { + "name": "schema_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "type": { + "name": "type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "change_kind": { + "name": "change_kind", + "type": "varchar(16)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "analysis_object_revision_object_number": { + "name": "analysis_object_revision_object_number", + "columns": [ + { + "expression": "object_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "revision_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_object_revision_one_staged_per_run": { + "name": "analysis_object_revision_one_staged_per_run", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "object_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((status)::text = ANY (ARRAY[('staged'::character varying)::text, ('candidate'::character varying)::text]))", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_object_revision_run_status": { + "name": "analysis_object_revision_run_status", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_object_revision_object_id_foreign": { + "name": "analysis_object_revision_object_id_foreign", + "tableFrom": "analysis_object_revision", + "tableTo": "analysis_object", + "columnsFrom": [ + "object_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_object_revision_parent_revision_id_foreign": { + "name": "analysis_object_revision_parent_revision_id_foreign", + "tableFrom": "analysis_object_revision", + "tableTo": "analysis_object_revision", + "columnsFrom": [ + "parent_revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_object_revision_project_id_foreign": { + "name": "analysis_object_revision_project_id_foreign", + "tableFrom": "analysis_object_revision", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_object_revision_run_id_foreign": { + "name": "analysis_object_revision_run_id_foreign", + "tableFrom": "analysis_object_revision", + "tableTo": "analysis_run", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_object_revision_change_kind_authored": { + "name": "analysis_object_revision_change_kind_authored", + "value": "(change_kind IS NULL) OR ((origin)::text = 'authored'::text)" + }, + "analysis_object_revision_change_kind_valid": { + "name": "analysis_object_revision_change_kind_valid", + "value": "(change_kind IS NULL) OR ((change_kind)::text = ANY (ARRAY[('typo'::character varying)::text, ('clarity'::character varying)::text, ('meaning'::character varying)::text, ('withdraw'::character varying)::text, ('restore'::character varying)::text, ('rollback'::character varying)::text]))" + }, + "analysis_object_revision_generated_provenance": { + "name": "analysis_object_revision_generated_provenance", + "value": "((origin)::text <> 'generated'::text) OR ((((provenance)::jsonb ->> 'runId'::text) IS NOT NULL) AND (((provenance)::jsonb ->> 'recipeId'::text) IS NOT NULL))" + }, + "analysis_object_revision_hash_version_valid": { + "name": "analysis_object_revision_hash_version_valid", + "value": "(hash_version)::text = 'c14n-v1'::text" + }, + "analysis_object_revision_numbers_valid": { + "name": "analysis_object_revision_numbers_valid", + "value": "(revision_number >= 1) AND (schema_version >= 1)" + }, + "analysis_object_revision_origin_valid": { + "name": "analysis_object_revision_origin_valid", + "value": "(origin)::text = ANY (ARRAY[('generated'::character varying)::text, ('authored'::character varying)::text, ('imported'::character varying)::text])" + }, + "analysis_object_revision_published_at": { + "name": "analysis_object_revision_published_at", + "value": "((status)::text <> 'published'::text) OR (published_at IS NOT NULL)" + }, + "analysis_object_revision_status_valid": { + "name": "analysis_object_revision_status_valid", + "value": "(status)::text = ANY (ARRAY[('staged'::character varying)::text, ('candidate'::character varying)::text, ('published'::character varying)::text, ('discarded'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.analysis_outbox": { + "name": "analysis_outbox", + "schema": "", + "columns": { + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "claim": { + "name": "claim", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "consumers": { + "name": "consumers", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "delivered_at": { + "name": "delivered_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "event_type": { + "name": "event_type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "next_attempt_at": { + "name": "next_attempt_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payload": { + "name": "payload", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sequence": { + "name": "sequence", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "analysis_outbox_due": { + "name": "analysis_outbox_due", + "columns": [ + { + "expression": "next_attempt_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = ANY (ARRAY[('pending'::character varying)::text, ('dispatching'::character varying)::text]))", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_outbox_scope_sequence": { + "name": "analysis_outbox_scope_sequence", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sequence", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_outbox_project_id_foreign": { + "name": "analysis_outbox_project_id_foreign", + "tableFrom": "analysis_outbox", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_outbox_run_id_foreign": { + "name": "analysis_outbox_run_id_foreign", + "tableFrom": "analysis_outbox", + "tableTo": "analysis_run", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_outbox_scope_id_foreign": { + "name": "analysis_outbox_scope_id_foreign", + "tableFrom": "analysis_outbox", + "tableTo": "analysis_scope", + "columnsFrom": [ + "scope_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_outbox_snapshot_id_foreign": { + "name": "analysis_outbox_snapshot_id_foreign", + "tableFrom": "analysis_outbox", + "tableTo": "analysis_snapshot", + "columnsFrom": [ + "snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_outbox_counters_valid": { + "name": "analysis_outbox_counters_valid", + "value": "(sequence >= 1) AND (attempts >= 0)" + }, + "analysis_outbox_status_valid": { + "name": "analysis_outbox_status_valid", + "value": "(status)::text = ANY (ARRAY[('pending'::character varying)::text, ('dispatching'::character varying)::text, ('delivered'::character varying)::text, ('dead'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.analysis_relation": { + "name": "analysis_relation", + "schema": "", + "columns": { + "attributes": { + "name": "attributes", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "basis": { + "name": "basis", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "content_hash": { + "name": "content_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "from_object_id": { + "name": "from_object_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "from_revision_id": { + "name": "from_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "hash_version": { + "name": "hash_version", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'c14n-v1'" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provenance": { + "name": "provenance", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "published_at": { + "name": "published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "to_object_id": { + "name": "to_object_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "to_revision_id": { + "name": "to_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": { + "analysis_relation_one_staged_per_run": { + "name": "analysis_relation_one_staged_per_run", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "from_revision_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "to_revision_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((status)::text = 'staged'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_relation_published_from": { + "name": "analysis_relation_published_from", + "columns": [ + { + "expression": "from_revision_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'published'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_relation_published_to": { + "name": "analysis_relation_published_to", + "columns": [ + { + "expression": "to_revision_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'published'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_relation_run_status": { + "name": "analysis_relation_run_status", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_relation_from_object_id_foreign": { + "name": "analysis_relation_from_object_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "analysis_object", + "columnsFrom": [ + "from_object_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_relation_from_revision_id_foreign": { + "name": "analysis_relation_from_revision_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "analysis_object_revision", + "columnsFrom": [ + "from_revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_relation_project_id_foreign": { + "name": "analysis_relation_project_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_relation_run_id_foreign": { + "name": "analysis_relation_run_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "analysis_run", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_relation_to_object_id_foreign": { + "name": "analysis_relation_to_object_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "analysis_object", + "columnsFrom": [ + "to_object_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_relation_to_revision_id_foreign": { + "name": "analysis_relation_to_revision_id_foreign", + "tableFrom": "analysis_relation", + "tableTo": "analysis_object_revision", + "columnsFrom": [ + "to_revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_relation_basis_valid": { + "name": "analysis_relation_basis_valid", + "value": "(basis)::text = ANY (ARRAY[('extracted'::character varying)::text, ('inferred'::character varying)::text, ('authored'::character varying)::text])" + }, + "analysis_relation_hash_version_valid": { + "name": "analysis_relation_hash_version_valid", + "value": "(hash_version)::text = 'c14n-v1'::text" + }, + "analysis_relation_not_reflexive": { + "name": "analysis_relation_not_reflexive", + "value": "from_revision_id <> to_revision_id" + }, + "analysis_relation_status_valid": { + "name": "analysis_relation_status_valid", + "value": "(status)::text = ANY (ARRAY[('staged'::character varying)::text, ('published'::character varying)::text, ('discarded'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.analysis_request_key": { + "name": "analysis_request_key", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "idempotency_key": { + "name": "idempotency_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "mode": { + "name": "mode", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "analysis_request_key_project_key": { + "name": "analysis_request_key_project_key", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "idempotency_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_request_key_run": { + "name": "analysis_request_key_run", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_request_key_project_id_foreign": { + "name": "analysis_request_key_project_id_foreign", + "tableFrom": "analysis_request_key", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_request_key_run_id_foreign": { + "name": "analysis_request_key_run_id_foreign", + "tableFrom": "analysis_request_key", + "tableTo": "analysis_run", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_request_key_scope_id_foreign": { + "name": "analysis_request_key_scope_id_foreign", + "tableFrom": "analysis_request_key", + "tableTo": "analysis_scope", + "columnsFrom": [ + "scope_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_request_key_mode_valid": { + "name": "analysis_request_key_mode_valid", + "value": "(mode)::text = ANY (ARRAY[('refresh'::character varying)::text, ('regenerate'::character varying)::text, ('retry'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.analysis_run": { + "name": "analysis_run", + "schema": "", + "columns": { + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "checks": { + "name": "checks", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "context": { + "name": "context", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "definition": { + "name": "definition", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "depends_on": { + "name": "depends_on", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "epoch": { + "name": "epoch", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "execution_ref": { + "name": "execution_ref", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "free_period_start": { + "name": "free_period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "free_account_id": { + "name": "free_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "hash_version": { + "name": "hash_version", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'c14n-v1'" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "idempotency_key": { + "name": "idempotency_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "input_fingerprint": { + "name": "input_fingerprint", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "input_manifest": { + "name": "input_manifest", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "lease": { + "name": "lease", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "lease_expires_at": { + "name": "lease_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "metrics": { + "name": "metrics", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "mode": { + "name": "mode", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "output_manifest": { + "name": "output_manifest", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "parameters": { + "name": "parameters", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "progress": { + "name": "progress", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "recipe_id": { + "name": "recipe_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "recipe_version": { + "name": "recipe_version", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "request_fingerprint": { + "name": "request_fingerprint", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "request_order": { + "name": "request_order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "requested_by": { + "name": "requested_by", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "reused_run_id": { + "name": "reused_run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "writer_fence": { + "name": "writer_fence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "analysis_run_one_active_request": { + "name": "analysis_run_one_active_request", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "request_fingerprint", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((status)::text = ANY (ARRAY[('queued'::character varying)::text, ('waiting_for_inputs'::character varying)::text, ('running'::character varying)::text]))", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_project_idempotency": { + "name": "analysis_run_project_idempotency", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "idempotency_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_running_expiry": { + "name": "analysis_run_running_expiry", + "columns": [ + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'running'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_running_lease": { + "name": "analysis_run_running_lease", + "columns": [ + { + "expression": "recipe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "lease_expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'running'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_scope_request_order": { + "name": "analysis_run_scope_request_order", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "request_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_scope_status_created": { + "name": "analysis_run_scope_status_created", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "first" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_free_charged": { + "name": "analysis_run_free_charged", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "(free_period_start IS NOT NULL)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_run_waiting_by_project": { + "name": "analysis_run_waiting_by_project", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "((status)::text = 'waiting_for_inputs'::text)", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_run_project_id_foreign": { + "name": "analysis_run_project_id_foreign", + "tableFrom": "analysis_run", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_run_reused_run_id_foreign": { + "name": "analysis_run_reused_run_id_foreign", + "tableFrom": "analysis_run", + "tableTo": "analysis_run", + "columnsFrom": [ + "reused_run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_run_scope_id_foreign": { + "name": "analysis_run_scope_id_foreign", + "tableFrom": "analysis_run", + "tableTo": "analysis_scope", + "columnsFrom": [ + "scope_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_run_counters_valid": { + "name": "analysis_run_counters_valid", + "value": "(request_order >= 1) AND (epoch >= 0) AND (attempt >= 0)" + }, + "analysis_run_hash_version_valid": { + "name": "analysis_run_hash_version_valid", + "value": "(hash_version)::text = 'c14n-v1'::text" + }, + "analysis_run_mode_valid": { + "name": "analysis_run_mode_valid", + "value": "(mode)::text = ANY (ARRAY[('refresh'::character varying)::text, ('regenerate'::character varying)::text, ('retry'::character varying)::text])" + }, + "analysis_run_ready_has_manifest": { + "name": "analysis_run_ready_has_manifest", + "value": "((status)::text <> 'ready'::text) OR (output_manifest IS NOT NULL)" + }, + "analysis_run_running_has_lease": { + "name": "analysis_run_running_has_lease", + "value": "((status)::text <> 'running'::text) OR ((lease IS NOT NULL) AND (lease_expires_at IS NOT NULL))" + }, + "analysis_run_status_valid": { + "name": "analysis_run_status_valid", + "value": "(status)::text = ANY (ARRAY[('queued'::character varying)::text, ('waiting_for_inputs'::character varying)::text, ('running'::character varying)::text, ('needs_review'::character varying)::text, ('ready'::character varying)::text, ('failed'::character varying)::text, ('cancelled'::character varying)::text, ('superseded'::character varying)::text])" + }, + "analysis_run_writer_fence_valid": { + "name": "analysis_run_writer_fence_valid", + "value": "writer_fence >= 0" + } + }, + "isRLSEnabled": false + }, + "public.analysis_scope": { + "name": "analysis_scope", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "current_request_order": { + "name": "current_request_order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "current_run_id": { + "name": "current_run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "current_snapshot_id": { + "name": "current_snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "generation_epoch": { + "name": "generation_epoch", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "next_request_order": { + "name": "next_request_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "publication_sequence": { + "name": "publication_sequence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "recipe_id": { + "name": "recipe_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "scope_key": { + "name": "scope_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "view_id": { + "name": "view_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "writer": { + "name": "writer", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'analysis'" + }, + "writer_fence": { + "name": "writer_fence", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "analysis_scope_producer_identity": { + "name": "analysis_scope_producer_identity", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "recipe_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((kind)::text = 'producer'::text)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_scope_view_identity": { + "name": "analysis_scope_view_identity", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "view_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((kind)::text = 'view'::text)", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_scope_current_run_id_foreign": { + "name": "analysis_scope_current_run_id_foreign", + "tableFrom": "analysis_scope", + "tableTo": "analysis_run", + "columnsFrom": [ + "current_run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_scope_current_snapshot_id_foreign": { + "name": "analysis_scope_current_snapshot_id_foreign", + "tableFrom": "analysis_scope", + "tableTo": "analysis_snapshot", + "columnsFrom": [ + "current_snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_scope_project_id_foreign": { + "name": "analysis_scope_project_id_foreign", + "tableFrom": "analysis_scope", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_scope_counters_valid": { + "name": "analysis_scope_counters_valid", + "value": "(next_request_order >= 1) AND (generation_epoch >= 0) AND (publication_sequence >= 0) AND (writer_fence >= 0) AND ((current_request_order IS NULL) OR (current_request_order >= 1))" + }, + "analysis_scope_kind_valid": { + "name": "analysis_scope_kind_valid", + "value": "(((kind)::text = 'producer'::text) AND (recipe_id IS NOT NULL) AND (view_id IS NULL) AND (current_snapshot_id IS NULL)) OR (((kind)::text = 'view'::text) AND (view_id IS NOT NULL) AND (recipe_id IS NULL) AND (current_run_id IS NULL))" + }, + "analysis_scope_writer_valid": { + "name": "analysis_scope_writer_valid", + "value": "(writer)::text = ANY (ARRAY[('legacy'::character varying)::text, ('analysis'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.analysis_snapshot": { + "name": "analysis_snapshot", + "schema": "", + "columns": { + "content_hash": { + "name": "content_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "embedding_config": { + "name": "embedding_config", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "hash_version": { + "name": "hash_version", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'c14n-v1'" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "manifest": { + "name": "manifest", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "manifest_version": { + "name": "manifest_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "parent_snapshot_id": { + "name": "parent_snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "scope_id": { + "name": "scope_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "settings": { + "name": "settings", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "source_event_id": { + "name": "source_event_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "versions": { + "name": "versions", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "view_id": { + "name": "view_id", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": { + "analysis_snapshot_scope_created": { + "name": "analysis_snapshot_scope_created", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "first" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_snapshot_scope_source_event": { + "name": "analysis_snapshot_scope_source_event", + "columns": [ + { + "expression": "scope_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_event_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "(source_event_id IS NOT NULL)", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_snapshot_parent_snapshot_id_foreign": { + "name": "analysis_snapshot_parent_snapshot_id_foreign", + "tableFrom": "analysis_snapshot", + "tableTo": "analysis_snapshot", + "columnsFrom": [ + "parent_snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_snapshot_project_id_foreign": { + "name": "analysis_snapshot_project_id_foreign", + "tableFrom": "analysis_snapshot", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_snapshot_scope_id_foreign": { + "name": "analysis_snapshot_scope_id_foreign", + "tableFrom": "analysis_snapshot", + "tableTo": "analysis_scope", + "columnsFrom": [ + "scope_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_snapshot_hash_version_valid": { + "name": "analysis_snapshot_hash_version_valid", + "value": "(hash_version)::text = 'c14n-v1'::text" + }, + "analysis_snapshot_manifest_version_valid": { + "name": "analysis_snapshot_manifest_version_valid", + "value": "manifest_version >= 1" + } + }, + "isRLSEnabled": false + }, + "public.analysis_step": { + "name": "analysis_step", + "schema": "", + "columns": { + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "cache_key": { + "name": "cache_key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "checkpoint": { + "name": "checkpoint", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hash_version": { + "name": "hash_version", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'c14n-v1'" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "lease": { + "name": "lease", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "output": { + "name": "output", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "reused_step_id": { + "name": "reused_step_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "step_key": { + "name": "step_key", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "step_version": { + "name": "step_version", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "usage": { + "name": "usage", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "validation": { + "name": "validation", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "analysis_step_project_cache": { + "name": "analysis_step_project_cache", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cache_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "completed_at", + "isExpression": false, + "asc": false, + "nulls": "first" + } + ], + "isUnique": false, + "where": "(((status)::text = 'completed'::text) AND (reused_step_id IS NULL))", + "concurrently": false, + "method": "btree", + "with": {} + }, + "analysis_step_run_step": { + "name": "analysis_step_run_step", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "step_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "analysis_step_project_id_foreign": { + "name": "analysis_step_project_id_foreign", + "tableFrom": "analysis_step", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "analysis_step_reused_step_id_foreign": { + "name": "analysis_step_reused_step_id_foreign", + "tableFrom": "analysis_step", + "tableTo": "analysis_step", + "columnsFrom": [ + "reused_step_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "analysis_step_run_id_foreign": { + "name": "analysis_step_run_id_foreign", + "tableFrom": "analysis_step", + "tableTo": "analysis_run", + "columnsFrom": [ + "run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "analysis_step_attempt_valid": { + "name": "analysis_step_attempt_valid", + "value": "attempt >= 1" + }, + "analysis_step_hash_version_valid": { + "name": "analysis_step_hash_version_valid", + "value": "(hash_version)::text = 'c14n-v1'::text" + }, + "analysis_step_kind_valid": { + "name": "analysis_step_kind_valid", + "value": "(kind)::text = ANY (ARRAY[('model'::character varying)::text, ('deterministic'::character varying)::text, ('check'::character varying)::text])" + }, + "analysis_step_status_valid": { + "name": "analysis_step_status_valid", + "value": "(status)::text = ANY (ARRAY[('running'::character varying)::text, ('completed'::character varying)::text, ('failed'::character varying)::text])" + } + }, + "isRLSEnabled": false + }, + "public.announcement": { + "name": "announcement", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "level": { + "name": "level", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "announcement_user_created_foreign": { + "name": "announcement_user_created_foreign", + "tableFrom": "announcement", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "announcement_user_updated_foreign": { + "name": "announcement_user_updated_foreign", + "tableFrom": "announcement", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.announcement_activity": { + "name": "announcement_activity", + "schema": "", + "columns": { + "announcement_activity": { + "name": "announcement_activity", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "read": { + "name": "read", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "announcement_activity_announcement_activity_foreign": { + "name": "announcement_activity_announcement_activity_foreign", + "tableFrom": "announcement_activity", + "tableTo": "announcement", + "columnsFrom": [ + "announcement_activity" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "announcement_activity_user_created_foreign": { + "name": "announcement_activity_user_created_foreign", + "tableFrom": "announcement_activity", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "announcement_activity_user_updated_foreign": { + "name": "announcement_activity_user_updated_foreign", + "tableFrom": "announcement_activity", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.announcement_translations": { + "name": "announcement_translations", + "schema": "", + "columns": { + "announcement_id": { + "name": "announcement_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "languages_code": { + "name": "languages_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "announcement_translations_announcement_id_foreign": { + "name": "announcement_translations_announcement_id_foreign", + "tableFrom": "announcement_translations", + "tableTo": "announcement", + "columnsFrom": [ + "announcement_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "announcement_translations_languages_code_foreign": { + "name": "announcement_translations_languages_code_foreign", + "tableFrom": "announcement_translations", + "tableTo": "languages", + "columnsFrom": [ + "languages_code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.app_user": { + "name": "app_user", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "display_name": { + "name": "display_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "onboarding_answer_json": { + "name": "onboarding_answer_json", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "terms_accepted_at": { + "name": "terms_accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "settings": { + "name": "settings", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "app_user_directus_user_id_unique": { + "name": "app_user_directus_user_id_unique", + "nullsNotDistinct": false, + "columns": [ + "directus_user_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.billing_account": { + "name": "billing_account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "billing_period": { + "name": "billing_period", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "downgraded_at": { + "name": "downgraded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "downgraded_from_tier": { + "name": "downgraded_from_tier", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "label": { + "name": "label", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "mollie_customer_id": { + "name": "mollie_customer_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "mollie_subscription_id": { + "name": "mollie_subscription_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payment_mode": { + "name": "payment_mode", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'none'" + }, + "percent_discount": { + "name": "percent_discount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "pre_warning_sent": { + "name": "pre_warning_sent", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "provisioned_seats": { + "name": "provisioned_seats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "tier": { + "name": "tier", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'free'" + }, + "tier_expires_at": { + "name": "tier_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "type_discount": { + "name": "type_discount", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "account_manager_id": { + "name": "account_manager_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "recording_project_id": { + "name": "recording_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "billing_address_line1": { + "name": "billing_address_line1", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_address_line2": { + "name": "billing_address_line2", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_city": { + "name": "billing_city", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_country": { + "name": "billing_country", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_legal_name": { + "name": "billing_legal_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_postal_code": { + "name": "billing_postal_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_vat_id": { + "name": "billing_vat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "billing_vat_region": { + "name": "billing_vat_region", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "payment_failed_notified": { + "name": "payment_failed_notified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "reconcile_failed_at": { + "name": "reconcile_failed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "kvk_number": { + "name": "kvk_number", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "kbo_number": { + "name": "kbo_number", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "billing_email": { + "name": "billing_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "po_number": { + "name": "po_number", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "peppol_id": { + "name": "peppol_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "peppol_name": { + "name": "peppol_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "invoice_delivery": { + "name": "invoice_delivery", + "type": "varchar(16)", + "primaryKey": false, + "notNull": false + }, + "billing_country_code": { + "name": "billing_country_code", + "type": "varchar(2)", + "primaryKey": false, + "notNull": false + }, + "no_vat_number": { + "name": "no_vat_number", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "invoice_portal": { + "name": "invoice_portal", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ai_budget_micro_eur": { + "name": "ai_budget_micro_eur", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "ai_budget_unlimited": { + "name": "ai_budget_unlimited", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "ai_budget_until": { + "name": "ai_budget_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "billing_account_account_manager_id_foreign": { + "name": "billing_account_account_manager_id_foreign", + "tableFrom": "billing_account", + "tableTo": "app_user", + "columnsFrom": [ + "account_manager_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "billing_account_created_by_foreign": { + "name": "billing_account_created_by_foreign", + "tableFrom": "billing_account", + "tableTo": "app_user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "billing_account_org_id_foreign": { + "name": "billing_account_org_id_foreign", + "tableFrom": "billing_account", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "billing_account_workspace_id_foreign": { + "name": "billing_account_workspace_id_foreign", + "tableFrom": "billing_account", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.canvas_config_revision": { + "name": "canvas_config_revision", + "schema": "", + "columns": { + "brief": { + "name": "brief", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cadence_minutes": { + "name": "cadence_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 5 + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "gather_spec": { + "name": "gather_spec", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "note": { + "name": "note", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "report_id": { + "name": "report_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "popcorn_settings": { + "name": "popcorn_settings", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "canvas_config_revision_report_id_foreign": { + "name": "canvas_config_revision_report_id_foreign", + "tableFrom": "canvas_config_revision", + "tableTo": "project_report", + "columnsFrom": [ + "report_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.canvas_generation": { + "name": "canvas_generation", + "schema": "", + "columns": { + "config_revision_id": { + "name": "config_revision_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "content_html": { + "name": "content_html", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "detail": { + "name": "detail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "report_id": { + "name": "report_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'ok'" + }, + "tick_kind": { + "name": "tick_kind", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "canvas_generation_config_revision_id_foreign": { + "name": "canvas_generation_config_revision_id_foreign", + "tableFrom": "canvas_generation", + "tableTo": "canvas_config_revision", + "columnsFrom": [ + "config_revision_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "canvas_generation_report_id_foreign": { + "name": "canvas_generation_report_id_foreign", + "tableFrom": "canvas_generation", + "tableTo": "project_report", + "columnsFrom": [ + "report_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation": { + "name": "conversation", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_all_chunks_transcribed": { + "name": "is_all_chunks_transcribed", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_anonymized": { + "name": "is_anonymized", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_audio_processing_finished": { + "name": "is_audio_processing_finished", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_finished": { + "name": "is_finished", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_over_cap": { + "name": "is_over_cap", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "merged_audio_path": { + "name": "merged_audio_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "merged_transcript": { + "name": "merged_transcript", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "participant_email": { + "name": "participant_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "participant_name": { + "name": "participant_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "participant_user_agent": { + "name": "participant_user_agent", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "move_history": { + "name": "move_history", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "token_count": { + "name": "token_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "recording_started_at": { + "name": "recording_started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "ai_stopped_at": { + "name": "ai_stopped_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "landscape_status": { + "name": "landscape_status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": false + }, + "landscape_review": { + "name": "landscape_review", + "type": "varchar(16)", + "primaryKey": false, + "notNull": false + }, + "landscape_text": { + "name": "landscape_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "landscape_text_hash": { + "name": "landscape_text_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "landscape_consent_version": { + "name": "landscape_consent_version", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false + }, + "landscape_decided_at": { + "name": "landscape_decided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "landscape_moderation": { + "name": "landscape_moderation", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "landscape_entered_at": { + "name": "landscape_entered_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "consent_accepted_at": { + "name": "consent_accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "consent_version": { + "name": "consent_version", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false + }, + "consent_basis": { + "name": "consent_basis", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_project_id_foreign": { + "name": "conversation_project_id_foreign", + "tableFrom": "conversation", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "conversation_landscape_status": { + "name": "conversation_landscape_status", + "value": "\"conversation\".\"landscape_status\" in ('pending', 'accepted', 'rejected')" + }, + "conversation_landscape_review": { + "name": "conversation_landscape_review", + "value": "\"conversation\".\"landscape_review\" in ('auto_approved', 'held', 'host_approved', 'host_rejected')" + }, + "conversation_landscape_entry": { + "name": "conversation_landscape_entry", + "value": "\"conversation\".\"landscape_entered_at\" is null or (coalesce(\"conversation\".\"landscape_status\", '') = 'accepted' and coalesce(\"conversation\".\"landscape_review\", '') in ('auto_approved', 'host_approved') and \"conversation\".\"landscape_text\" is not null)" + } + }, + "isRLSEnabled": false + }, + "public.conversation_artifact": { + "name": "conversation_artifact", + "schema": "", + "columns": { + "approved_at": { + "name": "approved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "last_updated_at": { + "name": "last_updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "read_aloud_stream_url": { + "name": "read_aloud_stream_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "topic_label": { + "name": "topic_label", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_artifact_conversation_id_foreign": { + "name": "conversation_artifact_conversation_id_foreign", + "tableFrom": "conversation_artifact", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "conversation_artifact_user_created_foreign": { + "name": "conversation_artifact_user_created_foreign", + "tableFrom": "conversation_artifact", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "conversation_artifact_user_updated_foreign": { + "name": "conversation_artifact_user_updated_foreign", + "tableFrom": "conversation_artifact", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_chunk": { + "name": "conversation_chunk", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "cross_talk_instances": { + "name": "cross_talk_instances", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "desired_language": { + "name": "desired_language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "detected_language": { + "name": "detected_language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "detected_language_confidence": { + "name": "detected_language_confidence", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "diarization": { + "name": "diarization", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hallucination_reason": { + "name": "hallucination_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hallucination_score": { + "name": "hallucination_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "noise_ratio": { + "name": "noise_ratio", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": "'0'" + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "pending_text": { + "name": "pending_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "raw_transcript": { + "name": "raw_transcript", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runpod_job_status_link": { + "name": "runpod_job_status_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "runpod_request_count": { + "name": "runpod_request_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "audio_seconds": { + "name": "audio_seconds", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "segments": { + "name": "segments", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "silence_ratio": { + "name": "silence_ratio", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": "'0'" + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "transcript": { + "name": "transcript", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "translation_error": { + "name": "translation_error", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": { + "conversation_chunk_timestamp_index": { + "name": "conversation_chunk_timestamp_index", + "columns": [ + { + "expression": "timestamp", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_chunk_conv_timestamp": { + "name": "idx_chunk_conv_timestamp", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "timestamp", + "isExpression": false, + "asc": false, + "nulls": "first" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversation_chunk_conversation_id_foreign": { + "name": "conversation_chunk_conversation_id_foreign", + "tableFrom": "conversation_chunk", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_final_transcript": { + "name": "conversation_final_transcript", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "chunk_hash": { + "name": "chunk_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_record": { + "name": "is_record", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sentences": { + "name": "sentences", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "raw_sentences": { + "name": "raw_sentences", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "audio_seconds": { + "name": "audio_seconds", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "usage": { + "name": "usage", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_final_transcript_conversation_id_foreign": { + "name": "conversation_final_transcript_conversation_id_foreign", + "tableFrom": "conversation_final_transcript", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "conversation_final_transcript_conversation_id_provider_pk": { + "name": "conversation_final_transcript_conversation_id_provider_pk", + "columns": [ + "conversation_id", + "provider" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_link": { + "name": "conversation_link", + "schema": "", + "columns": { + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "link_type": { + "name": "link_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "source_conversation_id": { + "name": "source_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "target_conversation_id": { + "name": "target_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "conversation_link_source_conversation_id_index": { + "name": "conversation_link_source_conversation_id_index", + "columns": [ + { + "expression": "source_conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "conversation_link_target_conversation_id_index": { + "name": "conversation_link_target_conversation_id_index", + "columns": [ + { + "expression": "target_conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "conversation_link_source_conversation_id_foreign": { + "name": "conversation_link_source_conversation_id_foreign", + "tableFrom": "conversation_link", + "tableTo": "conversation", + "columnsFrom": [ + "source_conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "conversation_link_target_conversation_id_foreign": { + "name": "conversation_link_target_conversation_id_foreign", + "tableFrom": "conversation_link", + "tableTo": "conversation", + "columnsFrom": [ + "target_conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_project_tag": { + "name": "conversation_project_tag", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "project_tag_id": { + "name": "project_tag_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_project_tag_conversation_id_foreign": { + "name": "conversation_project_tag_conversation_id_foreign", + "tableFrom": "conversation_project_tag", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "conversation_project_tag_project_tag_id_foreign": { + "name": "conversation_project_tag_project_tag_id_foreign", + "tableFrom": "conversation_project_tag", + "tableTo": "project_tag", + "columnsFrom": [ + "project_tag_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_reply": { + "name": "conversation_reply", + "schema": "", + "columns": { + "content_text": { + "name": "content_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "conversation_id": { + "name": "conversation_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "reply": { + "name": "reply", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_reply_reply_foreign": { + "name": "conversation_reply_reply_foreign", + "tableFrom": "conversation_reply", + "tableTo": "conversation", + "columnsFrom": [ + "reply" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.conversation_transcribe_retry": { + "name": "conversation_transcribe_retry", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "stage": { + "name": "stage", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "spans": { + "name": "spans", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "improved": { + "name": "improved", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "kept": { + "name": "kept", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "failed": { + "name": "failed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "conversation_transcribe_retry_conversation_id_foreign": { + "name": "conversation_transcribe_retry_conversation_id_foreign", + "tableFrom": "conversation_transcribe_retry", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "conversation_transcribe_retry_conversation_id_stage_pk": { + "name": "conversation_transcribe_retry_conversation_id_stage_pk", + "columns": [ + "conversation_id", + "stage" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_access": { + "name": "directus_access", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "role": { + "name": "role", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user": { + "name": "user", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "policy": { + "name": "policy", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_access_policy_foreign": { + "name": "directus_access_policy_foreign", + "tableFrom": "directus_access", + "tableTo": "directus_policies", + "columnsFrom": [ + "policy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_access_role_foreign": { + "name": "directus_access_role_foreign", + "tableFrom": "directus_access", + "tableTo": "directus_roles", + "columnsFrom": [ + "role" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_access_user_foreign": { + "name": "directus_access_user_foreign", + "tableFrom": "directus_access", + "tableTo": "directus_users", + "columnsFrom": [ + "user" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_activity": { + "name": "directus_activity", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "action": { + "name": "action", + "type": "varchar(45)", + "primaryKey": false, + "notNull": true + }, + "user": { + "name": "user", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "ip": { + "name": "ip", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "origin": { + "name": "origin", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_collections": { + "name": "directus_collections", + "schema": "", + "columns": { + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": true, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "display_template": { + "name": "display_template", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "singleton": { + "name": "singleton", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "translations": { + "name": "translations", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "archive_field": { + "name": "archive_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "archive_app_filter": { + "name": "archive_app_filter", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "archive_value": { + "name": "archive_value", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "unarchive_value": { + "name": "unarchive_value", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "sort_field": { + "name": "sort_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "accountability": { + "name": "accountability", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'all'" + }, + "color": { + "name": "color", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "item_duplication_fields": { + "name": "item_duplication_fields", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "group": { + "name": "group", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "collapse": { + "name": "collapse", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'open'" + }, + "preview_url": { + "name": "preview_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "versioning": { + "name": "versioning", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_collections_group_foreign": { + "name": "directus_collections_group_foreign", + "tableFrom": "directus_collections", + "tableTo": "directus_collections", + "columnsFrom": [ + "group" + ], + "columnsTo": [ + "collection" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_comments": { + "name": "directus_comments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_comments_user_created_foreign": { + "name": "directus_comments_user_created_foreign", + "tableFrom": "directus_comments", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "directus_comments_user_updated_foreign": { + "name": "directus_comments_user_updated_foreign", + "tableFrom": "directus_comments", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_dashboards": { + "name": "directus_dashboards", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "'dashboard'" + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_dashboards_user_created_foreign": { + "name": "directus_dashboards_user_created_foreign", + "tableFrom": "directus_dashboards", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_extensions": { + "name": "directus_extensions", + "schema": "", + "columns": { + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "folder": { + "name": "folder", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "bundle": { + "name": "bundle", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_fields": { + "name": "directus_fields", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "field": { + "name": "field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "special": { + "name": "special", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "interface": { + "name": "interface", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "options": { + "name": "options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "display": { + "name": "display", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "display_options": { + "name": "display_options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "readonly": { + "name": "readonly", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "varchar(30)", + "primaryKey": false, + "notNull": false, + "default": "'full'" + }, + "translations": { + "name": "translations", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "conditions": { + "name": "conditions", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "required": { + "name": "required", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "group": { + "name": "group", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "validation": { + "name": "validation", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "validation_message": { + "name": "validation_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "searchable": { + "name": "searchable", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_files": { + "name": "directus_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "storage": { + "name": "storage", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "filename_disk": { + "name": "filename_disk", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "filename_download": { + "name": "filename_download", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "folder": { + "name": "folder", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "uploaded_by": { + "name": "uploaded_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_on": { + "name": "created_on", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "modified_by": { + "name": "modified_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "modified_on": { + "name": "modified_on", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "charset": { + "name": "charset", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "filesize": { + "name": "filesize", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "width": { + "name": "width", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "height": { + "name": "height", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "embed": { + "name": "embed", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "focal_point_x": { + "name": "focal_point_x", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "focal_point_y": { + "name": "focal_point_y", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tus_id": { + "name": "tus_id", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "tus_data": { + "name": "tus_data", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "uploaded_on": { + "name": "uploaded_on", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_files_folder_foreign": { + "name": "directus_files_folder_foreign", + "tableFrom": "directus_files", + "tableTo": "directus_folders", + "columnsFrom": [ + "folder" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "directus_files_modified_by_foreign": { + "name": "directus_files_modified_by_foreign", + "tableFrom": "directus_files", + "tableTo": "directus_users", + "columnsFrom": [ + "modified_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_files_uploaded_by_foreign": { + "name": "directus_files_uploaded_by_foreign", + "tableFrom": "directus_files", + "tableTo": "directus_users", + "columnsFrom": [ + "uploaded_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_flows": { + "name": "directus_flows", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "trigger": { + "name": "trigger", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "accountability": { + "name": "accountability", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'all'" + }, + "options": { + "name": "options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "operation": { + "name": "operation", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_flows_user_created_foreign": { + "name": "directus_flows_user_created_foreign", + "tableFrom": "directus_flows", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "directus_flows_operation_unique": { + "name": "directus_flows_operation_unique", + "nullsNotDistinct": false, + "columns": [ + "operation" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_folders": { + "name": "directus_folders", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "parent": { + "name": "parent", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_folders_parent_foreign": { + "name": "directus_folders_parent_foreign", + "tableFrom": "directus_folders", + "tableTo": "directus_folders", + "columnsFrom": [ + "parent" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_migrations": { + "name": "directus_migrations", + "schema": "", + "columns": { + "version": { + "name": "version", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_notifications": { + "name": "directus_notifications", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'inbox'" + }, + "recipient": { + "name": "recipient", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sender": { + "name": "sender", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "subject": { + "name": "subject", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_notifications_recipient_foreign": { + "name": "directus_notifications_recipient_foreign", + "tableFrom": "directus_notifications", + "tableTo": "directus_users", + "columnsFrom": [ + "recipient" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_notifications_sender_foreign": { + "name": "directus_notifications_sender_foreign", + "tableFrom": "directus_notifications", + "tableTo": "directus_users", + "columnsFrom": [ + "sender" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_operations": { + "name": "directus_operations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "position_x": { + "name": "position_x", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "position_y": { + "name": "position_y", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "options": { + "name": "options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "resolve": { + "name": "resolve", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reject": { + "name": "reject", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "flow": { + "name": "flow", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_operations_flow_foreign": { + "name": "directus_operations_flow_foreign", + "tableFrom": "directus_operations", + "tableTo": "directus_flows", + "columnsFrom": [ + "flow" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_operations_reject_foreign": { + "name": "directus_operations_reject_foreign", + "tableFrom": "directus_operations", + "tableTo": "directus_operations", + "columnsFrom": [ + "reject" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_operations_resolve_foreign": { + "name": "directus_operations_resolve_foreign", + "tableFrom": "directus_operations", + "tableTo": "directus_operations", + "columnsFrom": [ + "resolve" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_operations_user_created_foreign": { + "name": "directus_operations_user_created_foreign", + "tableFrom": "directus_operations", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "directus_operations_resolve_unique": { + "name": "directus_operations_resolve_unique", + "nullsNotDistinct": false, + "columns": [ + "resolve" + ] + }, + "directus_operations_reject_unique": { + "name": "directus_operations_reject_unique", + "nullsNotDistinct": false, + "columns": [ + "reject" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_panels": { + "name": "directus_panels", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "dashboard": { + "name": "dashboard", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "color": { + "name": "color", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "show_header": { + "name": "show_header", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "position_x": { + "name": "position_x", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "position_y": { + "name": "position_y", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "width": { + "name": "width", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "height": { + "name": "height", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "options": { + "name": "options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_panels_dashboard_foreign": { + "name": "directus_panels_dashboard_foreign", + "tableFrom": "directus_panels", + "tableTo": "directus_dashboards", + "columnsFrom": [ + "dashboard" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_panels_user_created_foreign": { + "name": "directus_panels_user_created_foreign", + "tableFrom": "directus_panels", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_permissions": { + "name": "directus_permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "validation": { + "name": "validation", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "presets": { + "name": "presets", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "fields": { + "name": "fields", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "policy": { + "name": "policy", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "directus_permissions_policy_foreign": { + "name": "directus_permissions_policy_foreign", + "tableFrom": "directus_permissions", + "tableTo": "directus_policies", + "columnsFrom": [ + "policy" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_policies": { + "name": "directus_policies", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "'badge'" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ip_access": { + "name": "ip_access", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enforce_tfa": { + "name": "enforce_tfa", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "admin_access": { + "name": "admin_access", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "app_access": { + "name": "app_access", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_presets": { + "name": "directus_presets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "bookmark": { + "name": "bookmark", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "user": { + "name": "user", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "search": { + "name": "search", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "layout": { + "name": "layout", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false, + "default": "'tabular'" + }, + "layout_query": { + "name": "layout_query", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "layout_options": { + "name": "layout_options", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "refresh_interval": { + "name": "refresh_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "filter": { + "name": "filter", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "'bookmark'" + }, + "color": { + "name": "color", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_presets_role_foreign": { + "name": "directus_presets_role_foreign", + "tableFrom": "directus_presets", + "tableTo": "directus_roles", + "columnsFrom": [ + "role" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_presets_user_foreign": { + "name": "directus_presets_user_foreign", + "tableFrom": "directus_presets", + "tableTo": "directus_users", + "columnsFrom": [ + "user" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_relations": { + "name": "directus_relations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "many_collection": { + "name": "many_collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "many_field": { + "name": "many_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "one_collection": { + "name": "one_collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "one_field": { + "name": "one_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "one_collection_field": { + "name": "one_collection_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "one_allowed_collections": { + "name": "one_allowed_collections", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "junction_field": { + "name": "junction_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "sort_field": { + "name": "sort_field", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "one_deselect_action": { + "name": "one_deselect_action", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'nullify'" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_revisions": { + "name": "directus_revisions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "activity": { + "name": "activity", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "delta": { + "name": "delta", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "parent": { + "name": "parent", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "version": { + "name": "version", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_revisions_activity_foreign": { + "name": "directus_revisions_activity_foreign", + "tableFrom": "directus_revisions", + "tableTo": "directus_activity", + "columnsFrom": [ + "activity" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_revisions_parent_foreign": { + "name": "directus_revisions_parent_foreign", + "tableFrom": "directus_revisions", + "tableTo": "directus_revisions", + "columnsFrom": [ + "parent" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_revisions_version_foreign": { + "name": "directus_revisions_version_foreign", + "tableFrom": "directus_revisions", + "tableTo": "directus_versions", + "columnsFrom": [ + "version" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_roles": { + "name": "directus_roles", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "'supervised_user_circle'" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent": { + "name": "parent", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_roles_parent_foreign": { + "name": "directus_roles_parent_foreign", + "tableFrom": "directus_roles", + "tableTo": "directus_roles", + "columnsFrom": [ + "parent" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_sessions": { + "name": "directus_sessions", + "schema": "", + "columns": { + "token": { + "name": "token", + "type": "varchar(64)", + "primaryKey": true, + "notNull": true + }, + "user": { + "name": "user", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "expires": { + "name": "expires", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "ip": { + "name": "ip", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "share": { + "name": "share", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "origin": { + "name": "origin", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "next_token": { + "name": "next_token", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_sessions_share_foreign": { + "name": "directus_sessions_share_foreign", + "tableFrom": "directus_sessions", + "tableTo": "directus_shares", + "columnsFrom": [ + "share" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_sessions_user_foreign": { + "name": "directus_sessions_user_foreign", + "tableFrom": "directus_sessions", + "tableTo": "directus_users", + "columnsFrom": [ + "user" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_settings": { + "name": "directus_settings", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "project_name": { + "name": "project_name", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true, + "default": "'Directus'" + }, + "project_url": { + "name": "project_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "project_color": { + "name": "project_color", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'#6644FF'" + }, + "project_logo": { + "name": "project_logo", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_foreground": { + "name": "public_foreground", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_background": { + "name": "public_background", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_note": { + "name": "public_note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_login_attempts": { + "name": "auth_login_attempts", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 25 + }, + "auth_password_policy": { + "name": "auth_password_policy", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "storage_asset_transform": { + "name": "storage_asset_transform", + "type": "varchar(7)", + "primaryKey": false, + "notNull": false, + "default": "'all'" + }, + "storage_asset_presets": { + "name": "storage_asset_presets", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "custom_css": { + "name": "custom_css", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "storage_default_folder": { + "name": "storage_default_folder", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "basemaps": { + "name": "basemaps", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "mapbox_key": { + "name": "mapbox_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "module_bar": { + "name": "module_bar", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_descriptor": { + "name": "project_descriptor", + "type": "varchar(100)", + "primaryKey": false, + "notNull": false + }, + "default_language": { + "name": "default_language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'en-US'" + }, + "custom_aspect_ratios": { + "name": "custom_aspect_ratios", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "public_favicon": { + "name": "public_favicon", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "default_appearance": { + "name": "default_appearance", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'auto'" + }, + "default_theme_light": { + "name": "default_theme_light", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "theme_light_overrides": { + "name": "theme_light_overrides", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "default_theme_dark": { + "name": "default_theme_dark", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "theme_dark_overrides": { + "name": "theme_dark_overrides", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "report_error_url": { + "name": "report_error_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "report_bug_url": { + "name": "report_bug_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "report_feature_url": { + "name": "report_feature_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "public_registration": { + "name": "public_registration", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "public_registration_verify_email": { + "name": "public_registration_verify_email", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "public_registration_role": { + "name": "public_registration_role", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "public_registration_email_filter": { + "name": "public_registration_email_filter", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "visual_editor_urls": { + "name": "visual_editor_urls", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "mcp_enabled": { + "name": "mcp_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mcp_allow_deletes": { + "name": "mcp_allow_deletes", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "mcp_prompts_collection": { + "name": "mcp_prompts_collection", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "mcp_system_prompt_enabled": { + "name": "mcp_system_prompt_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "mcp_system_prompt": { + "name": "mcp_system_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_owner": { + "name": "project_owner", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "project_usage": { + "name": "project_usage", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "org_name": { + "name": "org_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "product_updates": { + "name": "product_updates", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "project_status": { + "name": "project_status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_settings_project_logo_foreign": { + "name": "directus_settings_project_logo_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_files", + "columnsFrom": [ + "project_logo" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_settings_public_background_foreign": { + "name": "directus_settings_public_background_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_files", + "columnsFrom": [ + "public_background" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_settings_public_favicon_foreign": { + "name": "directus_settings_public_favicon_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_files", + "columnsFrom": [ + "public_favicon" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_settings_public_foreground_foreign": { + "name": "directus_settings_public_foreground_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_files", + "columnsFrom": [ + "public_foreground" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "directus_settings_public_registration_role_foreign": { + "name": "directus_settings_public_registration_role_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_roles", + "columnsFrom": [ + "public_registration_role" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "directus_settings_storage_default_folder_foreign": { + "name": "directus_settings_storage_default_folder_foreign", + "tableFrom": "directus_settings", + "tableTo": "directus_folders", + "columnsFrom": [ + "storage_default_folder" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_shares": { + "name": "directus_shares", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "date_start": { + "name": "date_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_end": { + "name": "date_end", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "times_used": { + "name": "times_used", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "max_uses": { + "name": "max_uses", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_shares_collection_foreign": { + "name": "directus_shares_collection_foreign", + "tableFrom": "directus_shares", + "tableTo": "directus_collections", + "columnsFrom": [ + "collection" + ], + "columnsTo": [ + "collection" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_shares_role_foreign": { + "name": "directus_shares_role_foreign", + "tableFrom": "directus_shares", + "tableTo": "directus_roles", + "columnsFrom": [ + "role" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_shares_user_created_foreign": { + "name": "directus_shares_user_created_foreign", + "tableFrom": "directus_shares", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_sync_id_map": { + "name": "directus_sync_id_map", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "table": { + "name": "table", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "sync_id": { + "name": "sync_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "local_id": { + "name": "local_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": { + "directus_sync_id_map_created_at_index": { + "name": "directus_sync_id_map_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "directus_sync_id_map_table_local_id_unique": { + "name": "directus_sync_id_map_table_local_id_unique", + "nullsNotDistinct": false, + "columns": [ + "table", + "local_id" + ] + }, + "directus_sync_id_map_table_sync_id_unique": { + "name": "directus_sync_id_map_table_sync_id_unique", + "nullsNotDistinct": false, + "columns": [ + "table", + "sync_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_translations": { + "name": "directus_translations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "language": { + "name": "language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_users": { + "name": "directus_users", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "first_name": { + "name": "first_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "last_name": { + "name": "last_name", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "location": { + "name": "location", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tags": { + "name": "tags", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "avatar": { + "name": "avatar", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "language": { + "name": "language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "tfa_secret": { + "name": "tfa_secret", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "role": { + "name": "role", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "token": { + "name": "token", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "last_access": { + "name": "last_access", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_page": { + "name": "last_page", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true, + "default": "'default'" + }, + "external_identifier": { + "name": "external_identifier", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "auth_data": { + "name": "auth_data", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "email_notifications": { + "name": "email_notifications", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "appearance": { + "name": "appearance", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "theme_dark": { + "name": "theme_dark", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "theme_light": { + "name": "theme_light", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "theme_light_overrides": { + "name": "theme_light_overrides", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "theme_dark_overrides": { + "name": "theme_dark_overrides", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "text_direction": { + "name": "text_direction", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'auto'" + }, + "disable_create_project": { + "name": "disable_create_project", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "hide_ai_suggestions": { + "name": "hide_ai_suggestions", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "legal_basis": { + "name": "legal_basis", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'client-managed'" + }, + "privacy_policy_url": { + "name": "privacy_policy_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "quick_access_preferences": { + "name": "quick_access_preferences", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'::json" + }, + "whitelabel_logo": { + "name": "whitelabel_logo", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_users_role_foreign": { + "name": "directus_users_role_foreign", + "tableFrom": "directus_users", + "tableTo": "directus_roles", + "columnsFrom": [ + "role" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "directus_users_whitelabel_logo_foreign": { + "name": "directus_users_whitelabel_logo_foreign", + "tableFrom": "directus_users", + "tableTo": "directus_files", + "columnsFrom": [ + "whitelabel_logo" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "directus_users_email_unique": { + "name": "directus_users_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + }, + "directus_users_token_unique": { + "name": "directus_users_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + }, + "directus_users_external_identifier_unique": { + "name": "directus_users_external_identifier_unique", + "nullsNotDistinct": false, + "columns": [ + "external_identifier" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_versions": { + "name": "directus_versions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "collection": { + "name": "collection", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "item": { + "name": "item", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "delta": { + "name": "delta", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_versions_collection_foreign": { + "name": "directus_versions_collection_foreign", + "tableFrom": "directus_versions", + "tableTo": "directus_collections", + "columnsFrom": [ + "collection" + ], + "columnsTo": [ + "collection" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "directus_versions_user_created_foreign": { + "name": "directus_versions_user_created_foreign", + "tableFrom": "directus_versions", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "directus_versions_user_updated_foreign": { + "name": "directus_versions_user_updated_foreign", + "tableFrom": "directus_versions", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.directus_webhooks": { + "name": "directus_webhooks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "default": "'POST'" + }, + "url": { + "name": "url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "data": { + "name": "data", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "actions": { + "name": "actions", + "type": "varchar(100)", + "primaryKey": false, + "notNull": true + }, + "collections": { + "name": "collections", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true + }, + "headers": { + "name": "headers", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "was_active_before_deprecation": { + "name": "was_active_before_deprecation", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "migrated_flow": { + "name": "migrated_flow", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "directus_webhooks_migrated_flow_foreign": { + "name": "directus_webhooks_migrated_flow_foreign", + "tableFrom": "directus_webhooks", + "tableTo": "directus_flows", + "columnsFrom": [ + "migrated_flow" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.languages": { + "name": "languages", + "schema": "", + "columns": { + "code": { + "name": "code", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true, + "default": "NULL" + }, + "direction": { + "name": "direction", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'ltr'" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.map_embedding": { + "name": "map_embedding", + "schema": "", + "columns": { + "config_key": { + "name": "config_key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "dims": { + "name": "dims", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "input_hash": { + "name": "input_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "embedding": { + "name": "embedding", + "type": "vector", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "map_embedding_project_input_config": { + "name": "map_embedding_project_input_config", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "input_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "config_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "map_embedding_project_id_foreign": { + "name": "map_embedding_project_id_foreign", + "tableFrom": "map_embedding", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "map_embedding_dims_match": { + "name": "map_embedding_dims_match", + "value": "(dims > 0) AND (vector_dims(embedding) = dims)" + }, + "map_embedding_nonzero": { + "name": "map_embedding_nonzero", + "value": "vector_norm(embedding) > (0)::double precision" + } + }, + "isRLSEnabled": false + }, + "public.map_fact_check": { + "name": "map_fact_check", + "schema": "", + "columns": { + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "claim_key": { + "name": "claim_key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "justification": { + "name": "justification", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "prompt_version": { + "name": "prompt_version", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "requested_by": { + "name": "requested_by", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "sources": { + "name": "sources", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "statement": { + "name": "statement", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "verdict": { + "name": "verdict", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": { + "map_fact_check_project_claim": { + "name": "map_fact_check_project_claim", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "claim_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "map_fact_check_project_id_foreign": { + "name": "map_fact_check_project_id_foreign", + "tableFrom": "map_fact_check", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.map_group": { + "name": "map_group", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "selection_key": { + "name": "selection_key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "members": { + "name": "members", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true + }, + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false + }, + "prompt_version": { + "name": "prompt_version", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false + }, + "requested_by": { + "name": "requested_by", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "map_group_project_selection": { + "name": "map_group_project_selection", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "selection_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "map_group_project_id_foreign": { + "name": "map_group_project_id_foreign", + "tableFrom": "map_group", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.map_result": { + "name": "map_result", + "schema": "", + "columns": { + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "embedding_config": { + "name": "embedding_config", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "execution_ref": { + "name": "execution_ref", + "type": "varchar(128)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "manifest": { + "name": "manifest", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "manifest_version": { + "name": "manifest_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "progress": { + "name": "progress", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "recipe_version": { + "name": "recipe_version", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "requested_by": { + "name": "requested_by", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "snapshot_id": { + "name": "snapshot_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source_fingerprint": { + "name": "source_fingerprint", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(32)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "map_result_one_active_attempt": { + "name": "map_result_one_active_attempt", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "((status)::text = ANY (ARRAY[('queued'::character varying)::text, ('extracting'::character varying)::text, ('embedding'::character varying)::text]))", + "concurrently": false, + "method": "btree", + "with": {} + }, + "map_result_project_status_created": { + "name": "map_result_project_status_created", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": false, + "nulls": "first" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "map_result_project_id_foreign": { + "name": "map_result_project_id_foreign", + "tableFrom": "map_result", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "map_result_snapshot_id_foreign": { + "name": "map_result_snapshot_id_foreign", + "tableFrom": "map_result", + "tableTo": "analysis_snapshot", + "columnsFrom": [ + "snapshot_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "map_result_manifest_version_valid": { + "name": "map_result_manifest_version_valid", + "value": "manifest_version = ANY (ARRAY[1, 2])" + } + }, + "isRLSEnabled": false + }, + "public.methodology": { + "name": "methodology", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "framing": { + "name": "framing", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_seeded": { + "name": "is_seeded", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "owner_directus_user_id": { + "name": "owner_directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "visibility": { + "name": "visibility", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'private'" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "methodology_workspace_id_foreign": { + "name": "methodology_workspace_id_foreign", + "tableFrom": "methodology", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.methodology_version": { + "name": "methodology_version", + "schema": "", + "columns": { + "content": { + "name": "content", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "methodology_id": { + "name": "methodology_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "note": { + "name": "note", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "methodology_version_methodology_id_foreign": { + "name": "methodology_version_methodology_id_foreign", + "tableFrom": "methodology_version", + "tableTo": "methodology", + "columnsFrom": [ + "methodology_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.model_response_feedback": { + "name": "model_response_feedback", + "schema": "", + "columns": { + "chat_mode": { + "name": "chat_mode", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "comment": { + "name": "comment", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "context": { + "name": "context", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "rating": { + "name": "rating", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "reason": { + "name": "reason", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "reasons": { + "name": "reasons", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "response_snapshot": { + "name": "response_snapshot", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_id": { + "name": "target_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "target_type": { + "name": "target_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "model_response_feedback_project_id_foreign": { + "name": "model_response_feedback_project_id_foreign", + "tableFrom": "model_response_feedback", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "model_response_feedback_user_id_foreign": { + "name": "model_response_feedback_user_id_foreign", + "tableFrom": "model_response_feedback", + "tableTo": "directus_users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.notification": { + "name": "notification", + "schema": "", + "columns": { + "action": { + "name": "action", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'NONE'" + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "audience_user_id": { + "name": "audience_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "event_code": { + "name": "event_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "params": { + "name": "params", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "read_at": { + "name": "read_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "ref_chat_id": { + "name": "ref_chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ref_conversation_id": { + "name": "ref_conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ref_invite_id": { + "name": "ref_invite_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ref_org_id": { + "name": "ref_org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ref_project_id": { + "name": "ref_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "ref_report_id": { + "name": "ref_report_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "ref_workspace_id": { + "name": "ref_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "severity": { + "name": "severity", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'info'" + }, + "title": { + "name": "title", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": {}, + "foreignKeys": { + "notification_actor_user_id_foreign": { + "name": "notification_actor_user_id_foreign", + "tableFrom": "notification", + "tableTo": "app_user", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_audience_user_id_foreign": { + "name": "notification_audience_user_id_foreign", + "tableFrom": "notification", + "tableTo": "app_user", + "columnsFrom": [ + "audience_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "notification_ref_chat_id_foreign": { + "name": "notification_ref_chat_id_foreign", + "tableFrom": "notification", + "tableTo": "project_chat", + "columnsFrom": [ + "ref_chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_ref_conversation_id_foreign": { + "name": "notification_ref_conversation_id_foreign", + "tableFrom": "notification", + "tableTo": "conversation", + "columnsFrom": [ + "ref_conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_ref_invite_id_foreign": { + "name": "notification_ref_invite_id_foreign", + "tableFrom": "notification", + "tableTo": "workspace_invite", + "columnsFrom": [ + "ref_invite_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_ref_org_id_foreign": { + "name": "notification_ref_org_id_foreign", + "tableFrom": "notification", + "tableTo": "org", + "columnsFrom": [ + "ref_org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_ref_project_id_foreign": { + "name": "notification_ref_project_id_foreign", + "tableFrom": "notification", + "tableTo": "project", + "columnsFrom": [ + "ref_project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "notification_ref_workspace_id_foreign": { + "name": "notification_ref_workspace_id_foreign", + "tableFrom": "notification", + "tableTo": "workspace", + "columnsFrom": [ + "ref_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.org": { + "name": "org", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "logo_url": { + "name": "logo_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_partner": { + "name": "is_partner", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "agent_access_enabled": { + "name": "agent_access_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "agent_access_updated_at": { + "name": "agent_access_updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "agent_access_updated_by": { + "name": "agent_access_updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "account_stage": { + "name": "account_stage", + "type": "varchar(32)", + "primaryKey": false, + "notNull": false + }, + "origin_pricing_configuration_id": { + "name": "origin_pricing_configuration_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "org_created_by_foreign": { + "name": "org_created_by_foreign", + "tableFrom": "org", + "tableTo": "app_user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "org_origin_pricing_configuration_id_foreign": { + "name": "org_origin_pricing_configuration_id_foreign", + "tableFrom": "org", + "tableTo": "pricing_configuration", + "columnsFrom": [ + "origin_pricing_configuration_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "org_account_stage_check": { + "name": "org_account_stage_check", + "value": "\"org\".\"account_stage\" is null or \"org\".\"account_stage\" in ('prospect', 'customer', 'churned')" + } + }, + "isRLSEnabled": false + }, + "public.org_invite": { + "name": "org_invite", + "schema": "", + "columns": { + "accepted_at": { + "name": "accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "invited_by": { + "name": "invited_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'member'" + } + }, + "indexes": { + "org_invite_accepted_at_index": { + "name": "org_invite_accepted_at_index", + "columns": [ + { + "expression": "accepted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "org_invite_deleted_at_index": { + "name": "org_invite_deleted_at_index", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "org_invite_email_index": { + "name": "org_invite_email_index", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "org_invite_invited_by_foreign": { + "name": "org_invite_invited_by_foreign", + "tableFrom": "org_invite", + "tableTo": "app_user", + "columnsFrom": [ + "invited_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "org_invite_org_id_foreign": { + "name": "org_invite_org_id_foreign", + "tableFrom": "org_invite", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.org_membership": { + "name": "org_membership", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "custom_policies": { + "name": "custom_policies", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'::json" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "org_membership_user_id_index": { + "name": "org_membership_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "org_membership_org_id_foreign": { + "name": "org_membership_org_id_foreign", + "tableFrom": "org_membership", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "org_membership_user_id_foreign": { + "name": "org_membership_user_id_foreign", + "tableFrom": "org_membership", + "tableTo": "app_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.pricing_configuration": { + "name": "pricing_configuration", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "reference": { + "name": "reference", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "config_session_id": { + "name": "config_session_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'in_progress'" + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "user_id": { + "name": "user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "is_internal": { + "name": "is_internal", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locale": { + "name": "locale", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "mount": { + "name": "mount", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'app'" + }, + "wall_key": { + "name": "wall_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "org_id": { + "name": "org_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "question_set_version": { + "name": "question_set_version", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "config_shape_version": { + "name": "config_shape_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "answers_raw": { + "name": "answers_raw", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "volume_bucket": { + "name": "volume_bucket", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "concurrency_bucket": { + "name": "concurrency_bucket", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "concurrency_exact": { + "name": "concurrency_exact", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "answered_count": { + "name": "answered_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "furthest_step": { + "name": "furthest_step", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "voice_transcript": { + "name": "voice_transcript", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "voice_audio": { + "name": "voice_audio", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "booking_status": { + "name": "booking_status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "booking_uid": { + "name": "booking_uid", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "booking_notified_at": { + "name": "booking_notified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "submitted_at": { + "name": "submitted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "enquiry_notified_at": { + "name": "enquiry_notified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "pricing_configuration_reference_unique": { + "name": "pricing_configuration_reference_unique", + "nullsNotDistinct": false, + "columns": [ + "reference" + ] + }, + "pricing_configuration_config_session_id_unique": { + "name": "pricing_configuration_config_session_id_unique", + "nullsNotDistinct": false, + "columns": [ + "config_session_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.processing_status": { + "name": "processing_status", + "schema": "", + "columns": { + "conversation_chunk_id": { + "name": "conversation_chunk_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "duration_ms": { + "name": "duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "event": { + "name": "event", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent": { + "name": "parent", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "processing_status_conversation_chunk_id_index": { + "name": "processing_status_conversation_chunk_id_index", + "columns": [ + { + "expression": "conversation_chunk_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_processing_status_conversation_id_id": { + "name": "idx_processing_status_conversation_id_id", + "columns": [ + { + "expression": "conversation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "processing_status_parent_index": { + "name": "processing_status_parent_index", + "columns": [ + { + "expression": "parent", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "processing_status_project_id_index": { + "name": "processing_status_project_id_index", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "processing_status_conversation_chunk_id_foreign": { + "name": "processing_status_conversation_chunk_id_foreign", + "tableFrom": "processing_status", + "tableTo": "conversation_chunk", + "columnsFrom": [ + "conversation_chunk_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "processing_status_conversation_id_foreign": { + "name": "processing_status_conversation_id_foreign", + "tableFrom": "processing_status", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "processing_status_parent_foreign": { + "name": "processing_status_parent_foreign", + "tableFrom": "processing_status", + "tableTo": "processing_status", + "columnsFrom": [ + "parent" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "processing_status_project_id_foreign": { + "name": "processing_status_project_id_foreign", + "tableFrom": "processing_status", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project": { + "name": "project", + "schema": "", + "columns": { + "anonymize_transcripts": { + "name": "anonymize_transcripts", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "context": { + "name": "context", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "conversation_ask_for_participant_name_label": { + "name": "conversation_ask_for_participant_name_label", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "conversation_title_prompt": { + "name": "conversation_title_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "default_conversation_ask_for_participant_email": { + "name": "default_conversation_ask_for_participant_email", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "default_conversation_ask_for_participant_name": { + "name": "default_conversation_ask_for_participant_name", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "default_conversation_description": { + "name": "default_conversation_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_conversation_finish_text": { + "name": "default_conversation_finish_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_conversation_title": { + "name": "default_conversation_title", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "default_conversation_transcript_prompt": { + "name": "default_conversation_transcript_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "default_conversation_tutorial_slug": { + "name": "default_conversation_tutorial_slug", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'none'" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "enable_ai_title_and_tags": { + "name": "enable_ai_title_and_tags", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "get_reply_mode": { + "name": "get_reply_mode", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'summarize'" + }, + "get_reply_prompt": { + "name": "get_reply_prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "image_generation_model": { + "name": "image_generation_model", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'PLACEHOLDER'" + }, + "is_conversation_allowed": { + "name": "is_conversation_allowed", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "is_enhanced_audio_processing_enabled": { + "name": "is_enhanced_audio_processing_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_get_reply_enabled": { + "name": "is_get_reply_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_get_reply_cross_pollination_enabled": { + "name": "is_get_reply_cross_pollination_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "is_project_notification_subscription_allowed": { + "name": "is_project_notification_subscription_allowed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_verify_enabled": { + "name": "is_verify_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "is_verify_on_finish_enabled": { + "name": "is_verify_on_finish_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "language": { + "name": "language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "pin_order": { + "name": "pin_order", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "selected_verification_key_list": { + "name": "selected_verification_key_list", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "visibility": { + "name": "visibility", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'workspace'" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "host_guide": { + "name": "host_guide", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "move_history": { + "name": "move_history", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "methodology_version_id": { + "name": "methodology_version_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "is_canvas_enabled": { + "name": "is_canvas_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "legal_basis": { + "name": "legal_basis", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "privacy_policy_url": { + "name": "privacy_policy_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "is_dembrane_event_cta_enabled": { + "name": "is_dembrane_event_cta_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "is_sample": { + "name": "is_sample", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sample_version": { + "name": "sample_version", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "template_key": { + "name": "template_key", + "type": "varchar(64)", + "primaryKey": false, + "notNull": false + }, + "template_version": { + "name": "template_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_directus_user_id_foreign": { + "name": "project_directus_user_id_foreign", + "tableFrom": "project", + "tableTo": "directus_users", + "columnsFrom": [ + "directus_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_methodology_version_id_foreign": { + "name": "project_methodology_version_id_foreign", + "tableFrom": "project", + "tableTo": "methodology_version", + "columnsFrom": [ + "methodology_version_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_workspace_id_foreign": { + "name": "project_workspace_id_foreign", + "tableFrom": "project", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_agentic_run": { + "name": "project_agentic_run", + "schema": "", + "columns": { + "agent_thread_id": { + "name": "agent_thread_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "last_event_seq": { + "name": "last_event_seq", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "latest_error": { + "name": "latest_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "latest_error_code": { + "name": "latest_error_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "latest_output": { + "name": "latest_output", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_chat_id": { + "name": "project_chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'queued'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_agentic_run_project_chat_id_foreign": { + "name": "project_agentic_run_project_chat_id_foreign", + "tableFrom": "project_agentic_run", + "tableTo": "project_chat", + "columnsFrom": [ + "project_chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_agentic_run_project_id_foreign": { + "name": "project_agentic_run_project_id_foreign", + "tableFrom": "project_agentic_run", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_agentic_run_event": { + "name": "project_agentic_run_event", + "schema": "", + "columns": { + "event_type": { + "name": "event_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "project_agentic_run_id": { + "name": "project_agentic_run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "seq": { + "name": "seq", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": { + "project_agentic_run_event_run_seq_index": { + "name": "project_agentic_run_event_run_seq_index", + "columns": [ + { + "expression": "project_agentic_run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_agentic_run_event_project_agentic_run_id_foreign": { + "name": "project_agentic_run_event_project_agentic_run_id_foreign", + "tableFrom": "project_agentic_run_event", + "tableTo": "project_agentic_run", + "columnsFrom": [ + "project_agentic_run_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_chat": { + "name": "project_chat", + "schema": "", + "columns": { + "auto_select": { + "name": "auto_select", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "chat_mode": { + "name": "chat_mode", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "is_private": { + "name": "is_private", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "free_period_start": { + "name": "free_period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "project_chat_project_id_index": { + "name": "project_chat_project_id_index", + "columns": [ + { + "expression": "project_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_chat_project_id_foreign": { + "name": "project_chat_project_id_foreign", + "tableFrom": "project_chat", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_chat_user_created_foreign": { + "name": "project_chat_user_created_foreign", + "tableFrom": "project_chat", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "project_chat_user_updated_foreign": { + "name": "project_chat_user_updated_foreign", + "tableFrom": "project_chat", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_chat_conversation": { + "name": "project_chat_conversation", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "project_chat_id": { + "name": "project_chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_chat_conversation_conversation_id_foreign": { + "name": "project_chat_conversation_conversation_id_foreign", + "tableFrom": "project_chat_conversation", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_chat_conversation_project_chat_id_foreign": { + "name": "project_chat_conversation_project_chat_id_foreign", + "tableFrom": "project_chat_conversation", + "tableTo": "project_chat", + "columnsFrom": [ + "project_chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_chat_message": { + "name": "project_chat_message", + "schema": "", + "columns": { + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "message_from": { + "name": "message_from", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_chat_id": { + "name": "project_chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "template_key": { + "name": "template_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tokens_count": { + "name": "tokens_count", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "project_chat_message_project_chat_id_index": { + "name": "project_chat_message_project_chat_id_index", + "columns": [ + { + "expression": "project_chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "project_chat_message_project_chat_id_foreign": { + "name": "project_chat_message_project_chat_id_foreign", + "tableFrom": "project_chat_message", + "tableTo": "project_chat", + "columnsFrom": [ + "project_chat_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_chat_message_conversation": { + "name": "project_chat_message_conversation", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "project_chat_message_id": { + "name": "project_chat_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_chat_message_conversation_conversation_id_foreign": { + "name": "project_chat_message_conversation_conversation_id_foreign", + "tableFrom": "project_chat_message_conversation", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_chat_message_conversation_project___3af13f9a_foreign": { + "name": "project_chat_message_conversation_project___3af13f9a_foreign", + "tableFrom": "project_chat_message_conversation", + "tableTo": "project_chat_message", + "columnsFrom": [ + "project_chat_message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_chat_message_conversation_1": { + "name": "project_chat_message_conversation_1", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "project_chat_message_id": { + "name": "project_chat_message_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_chat_message_conversation_1_conversation_id_foreign": { + "name": "project_chat_message_conversation_1_conversation_id_foreign", + "tableFrom": "project_chat_message_conversation_1", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_chat_message_conversation_1_projec__225db2e8_foreign": { + "name": "project_chat_message_conversation_1_projec__225db2e8_foreign", + "tableFrom": "project_chat_message_conversation_1", + "tableTo": "project_chat_message", + "columnsFrom": [ + "project_chat_message_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_goal_revision": { + "name": "project_goal_revision", + "schema": "", + "columns": { + "chat_id": { + "name": "chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "set_by": { + "name": "set_by", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "project_goal_revision_project_id_foreign": { + "name": "project_goal_revision_project_id_foreign", + "tableFrom": "project_goal_revision", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_membership": { + "name": "project_membership", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "custom_policies": { + "name": "custom_policies", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'::json" + }, + "granted_by": { + "name": "granted_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "project_membership_granted_by_foreign": { + "name": "project_membership_granted_by_foreign", + "tableFrom": "project_membership", + "tableTo": "app_user", + "columnsFrom": [ + "granted_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_membership_project_id_foreign": { + "name": "project_membership_project_id_foreign", + "tableFrom": "project_membership", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "project_membership_user_id_foreign": { + "name": "project_membership_user_id_foreign", + "tableFrom": "project_membership", + "tableTo": "app_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_report": { + "name": "project_report", + "schema": "", + "columns": { + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "error_code": { + "name": "error_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "language": { + "name": "language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scheduled_at": { + "name": "scheduled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "show_portal_link": { + "name": "show_portal_link", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'published'" + }, + "user_instructions": { + "name": "user_instructions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'report'" + }, + "public_token": { + "name": "public_token", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "free_period_start": { + "name": "free_period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "free_account_id": { + "name": "free_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_report_project_id_foreign": { + "name": "project_report_project_id_foreign", + "tableFrom": "project_report", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_report_user_created_foreign": { + "name": "project_report_user_created_foreign", + "tableFrom": "project_report", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_report_metric": { + "name": "project_report_metric", + "schema": "", + "columns": { + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "ip": { + "name": "ip", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_report_id": { + "name": "project_report_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "project_report_metric_project_report_id_foreign": { + "name": "project_report_metric_project_report_id_foreign", + "tableFrom": "project_report_metric", + "tableTo": "project_report", + "columnsFrom": [ + "project_report_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_report_notification_participants": { + "name": "project_report_notification_participants", + "schema": "", + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "date_submitted": { + "name": "date_submitted", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "email_opt_in": { + "name": "email_opt_in", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "email_opt_out_token": { + "name": "email_opt_out_token", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_report_notification_participants_c__5f83ce3c_foreign": { + "name": "project_report_notification_participants_c__5f83ce3c_foreign", + "tableFrom": "project_report_notification_participants", + "tableTo": "conversation", + "columnsFrom": [ + "conversation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_tag": { + "name": "project_tag", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "text": { + "name": "text", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + } + }, + "indexes": {}, + "foreignKeys": { + "project_tag_project_id_foreign": { + "name": "project_tag_project_id_foreign", + "tableFrom": "project_tag", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.project_webhook": { + "name": "project_webhook", + "schema": "", + "columns": { + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "events": { + "name": "events", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "secret": { + "name": "secret", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'published'" + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "project_webhook_project_id_foreign": { + "name": "project_webhook_project_id_foreign", + "tableFrom": "project_webhook", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "project_webhook_user_created_foreign": { + "name": "project_webhook_user_created_foreign", + "tableFrom": "project_webhook", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "project_webhook_user_updated_foreign": { + "name": "project_webhook_user_updated_foreign", + "tableFrom": "project_webhook", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prompt_template": { + "name": "prompt_template", + "schema": "", + "columns": { + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "varchar(50)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_anonymous": { + "name": "is_anonymous", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "language": { + "name": "language", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tags": { + "name": "tags", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "varchar(200)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'user'" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "prompt_template_user_created_foreign": { + "name": "prompt_template_user_created_foreign", + "tableFrom": "prompt_template", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "prompt_template_workspace_id_foreign": { + "name": "prompt_template_workspace_id_foreign", + "tableFrom": "prompt_template", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recording_overage": { + "name": "recording_overage", + "schema": "", + "columns": { + "billing_account_id": { + "name": "billing_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "cap": { + "name": "cap", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "closed_notified_at": { + "name": "closed_notified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "excess": { + "name": "excess", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "opened_by_project_id": { + "name": "opened_by_project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "opened_notified_at": { + "name": "opened_notified_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "peak": { + "name": "peak", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recording_overage_billing_account_id_foreign": { + "name": "recording_overage_billing_account_id_foreign", + "tableFrom": "recording_overage", + "tableTo": "billing_account", + "columnsFrom": [ + "billing_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.referral_ledger": { + "name": "referral_ledger", + "schema": "", + "columns": { + "created_by_staff_id": { + "name": "created_by_staff_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "partner_kickback_percent": { + "name": "partner_kickback_percent", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 20 + }, + "partner_team_id": { + "name": "partner_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "starts_at": { + "name": "starts_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "CURRENT_TIMESTAMP" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "referral_ledger_created_by_staff_id_foreign": { + "name": "referral_ledger_created_by_staff_id_foreign", + "tableFrom": "referral_ledger", + "tableTo": "app_user", + "columnsFrom": [ + "created_by_staff_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "referral_ledger_partner_team_id_foreign": { + "name": "referral_ledger_partner_team_id_foreign", + "tableFrom": "referral_ledger", + "tableTo": "org", + "columnsFrom": [ + "partner_team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "referral_ledger_workspace_id_foreign": { + "name": "referral_ledger_workspace_id_foreign", + "tableFrom": "referral_ledger", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scheduled_task": { + "name": "scheduled_task", + "schema": "", + "columns": { + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "scheduled_at": { + "name": "scheduled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'scheduled'" + }, + "task_type": { + "name": "task_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'revoke_staff_support'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "scheduled_task_scheduled_at_index": { + "name": "scheduled_task_scheduled_at_index", + "columns": [ + { + "expression": "scheduled_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "scheduled_task_status_index": { + "name": "scheduled_task_status_index", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.support_access_event": { + "name": "support_access_event", + "schema": "", + "columns": { + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "event_code": { + "name": "event_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "params": { + "name": "params", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "staff_user_id": { + "name": "staff_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "support_access_event_created_at_index": { + "name": "support_access_event_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_access_event_event_code_index": { + "name": "support_access_event_event_code_index", + "columns": [ + { + "expression": "event_code", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "support_access_event_actor_user_id_foreign": { + "name": "support_access_event_actor_user_id_foreign", + "tableFrom": "support_access_event", + "tableTo": "app_user", + "columnsFrom": [ + "actor_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "support_access_event_staff_user_id_foreign": { + "name": "support_access_event_staff_user_id_foreign", + "tableFrom": "support_access_event", + "tableTo": "app_user", + "columnsFrom": [ + "staff_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "support_access_event_workspace_id_foreign": { + "name": "support_access_event_workspace_id_foreign", + "tableFrom": "support_access_event", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.support_access_request": { + "name": "support_access_request", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "membership_id": { + "name": "membership_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "requested_by": { + "name": "requested_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resolved_at": { + "name": "resolved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "resolved_by": { + "name": "resolved_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "support_access_request_status_index": { + "name": "support_access_request_status_index", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "support_access_request_membership_id_foreign": { + "name": "support_access_request_membership_id_foreign", + "tableFrom": "support_access_request", + "tableTo": "workspace_membership", + "columnsFrom": [ + "membership_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "support_access_request_requested_by_foreign": { + "name": "support_access_request_requested_by_foreign", + "tableFrom": "support_access_request", + "tableTo": "app_user", + "columnsFrom": [ + "requested_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "support_access_request_resolved_by_foreign": { + "name": "support_access_request_resolved_by_foreign", + "tableFrom": "support_access_request", + "tableTo": "app_user", + "columnsFrom": [ + "resolved_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "support_access_request_workspace_id_foreign": { + "name": "support_access_request_workspace_id_foreign", + "tableFrom": "support_access_request", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.support_request": { + "name": "support_request", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "page_context": { + "name": "page_context", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "project_chat_id": { + "name": "project_chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'new'" + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "app_user_id": { + "name": "app_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "chat_id": { + "name": "chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "message_id": { + "name": "message_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "forwarded_at": { + "name": "forwarded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.training": { + "name": "training", + "schema": "", + "columns": { + "base_price_eur": { + "name": "base_price_eur", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "extra_participants": { + "name": "extra_participants", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "extra_price_eur": { + "name": "extra_price_eur", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "grants_license": { + "name": "grants_license", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "included_participants": { + "name": "included_participants", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requested_by": { + "name": "requested_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "scheduled_at": { + "name": "scheduled_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'requested'" + }, + "type": { + "name": "type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'online'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "training_org_id_foreign": { + "name": "training_org_id_foreign", + "tableFrom": "training", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "training_requested_by_foreign": { + "name": "training_requested_by_foreign", + "tableFrom": "training", + "tableTo": "app_user", + "columnsFrom": [ + "requested_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.training_license": { + "name": "training_license", + "schema": "", + "columns": { + "app_user_id": { + "name": "app_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "granted_by": { + "name": "granted_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'active'" + }, + "training_id": { + "name": "training_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "training_license_app_user_id_foreign": { + "name": "training_license_app_user_id_foreign", + "tableFrom": "training_license", + "tableTo": "app_user", + "columnsFrom": [ + "app_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "training_license_granted_by_foreign": { + "name": "training_license_granted_by_foreign", + "tableFrom": "training_license", + "tableTo": "app_user", + "columnsFrom": [ + "granted_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "training_license_org_id_foreign": { + "name": "training_license_org_id_foreign", + "tableFrom": "training_license", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "training_license_training_id_foreign": { + "name": "training_license_training_id_foreign", + "tableFrom": "training_license", + "tableTo": "training", + "columnsFrom": [ + "training_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.usage_insight": { + "name": "usage_insight", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "directus_user_id": { + "name": "directus_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "insight_type": { + "name": "insight_type", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'intent'" + }, + "project_chat_id": { + "name": "project_chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "status": { + "name": "status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'new'" + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "app_user_id": { + "name": "app_user_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "chat_id": { + "name": "chat_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "message_id": { + "name": "message_id", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification_topic": { + "name": "verification_topic", + "schema": "", + "columns": { + "date_created": { + "name": "date_created", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "date_updated": { + "name": "date_updated", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "key": { + "name": "key", + "type": "varchar(255)", + "primaryKey": true, + "notNull": true, + "default": "NULL" + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "user_created": { + "name": "user_created", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "user_updated": { + "name": "user_updated", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "verification_topic_project_id_foreign": { + "name": "verification_topic_project_id_foreign", + "tableFrom": "verification_topic", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "verification_topic_user_created_foreign": { + "name": "verification_topic_user_created_foreign", + "tableFrom": "verification_topic", + "tableTo": "directus_users", + "columnsFrom": [ + "user_created" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "verification_topic_user_updated_foreign": { + "name": "verification_topic_user_updated_foreign", + "tableFrom": "verification_topic", + "tableTo": "directus_users", + "columnsFrom": [ + "user_updated" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification_topic_translations": { + "name": "verification_topic_translations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "label": { + "name": "label", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "languages_code": { + "name": "languages_code", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "verification_topic_key": { + "name": "verification_topic_key", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + } + }, + "indexes": {}, + "foreignKeys": { + "verification_topic_translations_languages_code_foreign": { + "name": "verification_topic_translations_languages_code_foreign", + "tableFrom": "verification_topic_translations", + "tableTo": "languages", + "columnsFrom": [ + "languages_code" + ], + "columnsTo": [ + "code" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "verification_topic_translations_verificati__34868e89_foreign": { + "name": "verification_topic_translations_verificati__34868e89_foreign", + "tableFrom": "verification_topic_translations", + "tableTo": "verification_topic", + "columnsFrom": [ + "verification_topic_key" + ], + "columnsTo": [ + "key" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace": { + "name": "workspace", + "schema": "", + "columns": { + "billed_to_team_id": { + "name": "billed_to_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "billed_to_workspace_id": { + "name": "billed_to_workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "effective_client_team_id": { + "name": "effective_client_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "handoff_status": { + "name": "handoff_status", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "handoff_target_team_id": { + "name": "handoff_target_team_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "legal_basis": { + "name": "legal_basis", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "logo_url": { + "name": "logo_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "name": { + "name": "name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "privacy_policy_url": { + "name": "privacy_policy_url", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "settings": { + "name": "settings", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'{}'::json" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "visibility": { + "name": "visibility", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "'open_to_organisation'" + }, + "billing_account_id": { + "name": "billing_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "usage_context": { + "name": "usage_context", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "data_owner_email": { + "name": "data_owner_email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "data_owner_org_name": { + "name": "data_owner_org_name", + "type": "varchar(255)", + "primaryKey": false, + "notNull": false, + "default": "NULL" + }, + "partner_agreement_accepted_at": { + "name": "partner_agreement_accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "allow_support_access": { + "name": "allow_support_access", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "context": { + "name": "context", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "workspace_billed_to_team_id_foreign": { + "name": "workspace_billed_to_team_id_foreign", + "tableFrom": "workspace", + "tableTo": "org", + "columnsFrom": [ + "billed_to_team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_billed_to_workspace_id_foreign": { + "name": "workspace_billed_to_workspace_id_foreign", + "tableFrom": "workspace", + "tableTo": "workspace", + "columnsFrom": [ + "billed_to_workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_billing_account_id_foreign": { + "name": "workspace_billing_account_id_foreign", + "tableFrom": "workspace", + "tableTo": "billing_account", + "columnsFrom": [ + "billing_account_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "workspace_created_by_foreign": { + "name": "workspace_created_by_foreign", + "tableFrom": "workspace", + "tableTo": "app_user", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_effective_client_team_id_foreign": { + "name": "workspace_effective_client_team_id_foreign", + "tableFrom": "workspace", + "tableTo": "org", + "columnsFrom": [ + "effective_client_team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_handoff_target_team_id_foreign": { + "name": "workspace_handoff_target_team_id_foreign", + "tableFrom": "workspace", + "tableTo": "org", + "columnsFrom": [ + "handoff_target_team_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_org_id_foreign": { + "name": "workspace_org_id_foreign", + "tableFrom": "workspace", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_invite": { + "name": "workspace_invite", + "schema": "", + "columns": { + "accepted_at": { + "name": "accepted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "email": { + "name": "email", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "invited_by": { + "name": "invited_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "workspace_invite_deleted_at_index": { + "name": "workspace_invite_deleted_at_index", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_invite_invited_by_foreign": { + "name": "workspace_invite_invited_by_foreign", + "tableFrom": "workspace_invite", + "tableTo": "app_user", + "columnsFrom": [ + "invited_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_invite_project_id_foreign": { + "name": "workspace_invite_project_id_foreign", + "tableFrom": "workspace_invite", + "tableTo": "project", + "columnsFrom": [ + "project_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_invite_workspace_id_foreign": { + "name": "workspace_invite_workspace_id_foreign", + "tableFrom": "workspace_invite", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_membership": { + "name": "workspace_membership", + "schema": "", + "columns": { + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "custom_policies": { + "name": "custom_policies", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'::json" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "role": { + "name": "role", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "NULL" + }, + "source": { + "name": "source", + "type": "varchar(255)", + "primaryKey": false, + "notNull": true, + "default": "'direct'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "CURRENT_TIMESTAMP" + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "workspace_membership_expires_at_index": { + "name": "workspace_membership_expires_at_index", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_membership_user_id_foreign": { + "name": "workspace_membership_user_id_foreign", + "tableFrom": "workspace_membership", + "tableTo": "app_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_membership_workspace_id_foreign": { + "name": "workspace_membership_workspace_id_foreign", + "tableFrom": "workspace_membership", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account_demo": { + "name": "account_demo", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'queued'" + }, + "input": { + "name": "input", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "steps": { + "name": "steps", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "pages": { + "name": "pages", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "research": { + "name": "research", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "research_markdown": { + "name": "research_markdown", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "corpus": { + "name": "corpus", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "seed": { + "name": "seed", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "offer_document_id": { + "name": "offer_document_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "invited_at": { + "name": "invited_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "published_at": { + "name": "published_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "account_demo_created_at_index": { + "name": "account_demo_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_demo_org_id_foreign": { + "name": "account_demo_org_id_foreign", + "tableFrom": "account_demo", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "account_demo_status_check": { + "name": "account_demo_status_check", + "value": "\"account_demo\".\"status\" in ('queued', 'running', 'draft', 'failed', 'published')" + } + }, + "isRLSEnabled": false + }, + "public.account_document": { + "name": "account_document", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'en'" + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "supersedes_id": { + "name": "supersedes_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reference": { + "name": "reference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "template": { + "name": "template", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content": { + "name": "content", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_key": { + "name": "file_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "page_count": { + "name": "page_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "requires_signature": { + "name": "requires_signature", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'draft'" + }, + "terms_text_id": { + "name": "terms_text_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "sla_text_id": { + "name": "sla_text_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "dpa_text_id": { + "name": "dpa_text_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "lines": { + "name": "lines", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "subtotal_cents": { + "name": "subtotal_cents", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "vat_cents": { + "name": "vat_cents", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "total_cents": { + "name": "total_cents", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valid_until": { + "name": "valid_until", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "external_ref": { + "name": "external_ref", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exact_id": { + "name": "exact_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "issued_on": { + "name": "issued_on", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "due_on": { + "name": "due_on", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "invoice_status": { + "name": "invoice_status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "paid_at": { + "name": "paid_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "payment_url": { + "name": "payment_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "payment_reference": { + "name": "payment_reference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signer_email": { + "name": "signer_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signer_name": { + "name": "signer_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signer_role": { + "name": "signer_role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signer_invited_at": { + "name": "signer_invited_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "sent_at": { + "name": "sent_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "viewed_at": { + "name": "viewed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "signed_at": { + "name": "signed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "declined_at": { + "name": "declined_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "decline_reason": { + "name": "decline_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "voided_at": { + "name": "voided_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "account_document_org_id_index": { + "name": "account_document_org_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "account_document_signer_email_index": { + "name": "account_document_signer_email_index", + "columns": [ + { + "expression": "signer_email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_document_org_id_foreign": { + "name": "account_document_org_id_foreign", + "tableFrom": "account_document", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "account_document_supersedes_id_foreign": { + "name": "account_document_supersedes_id_foreign", + "tableFrom": "account_document", + "tableTo": "account_document", + "columnsFrom": [ + "supersedes_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "account_document_terms_text_id_foreign": { + "name": "account_document_terms_text_id_foreign", + "tableFrom": "account_document", + "tableTo": "legal_text", + "columnsFrom": [ + "terms_text_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "account_document_sla_text_id_foreign": { + "name": "account_document_sla_text_id_foreign", + "tableFrom": "account_document", + "tableTo": "legal_text", + "columnsFrom": [ + "sla_text_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "account_document_dpa_text_id_foreign": { + "name": "account_document_dpa_text_id_foreign", + "tableFrom": "account_document", + "tableTo": "legal_text", + "columnsFrom": [ + "dpa_text_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "account_document_exact_id_unique": { + "name": "account_document_exact_id_unique", + "nullsNotDistinct": false, + "columns": [ + "exact_id" + ] + } + }, + "policies": {}, + "checkConstraints": { + "account_document_kind_check": { + "name": "account_document_kind_check", + "value": "\"account_document\".\"kind\" in ('offer', 'dpa', 'invoice', 'other')" + }, + "account_document_status_check": { + "name": "account_document_status_check", + "value": "\"account_document\".\"status\" in ('draft', 'sent', 'viewed', 'signed', 'declined', 'void')" + }, + "account_document_language_check": { + "name": "account_document_language_check", + "value": "\"account_document\".\"language\" in ('en', 'nl')" + }, + "account_document_invoice_status_check": { + "name": "account_document_invoice_status_check", + "value": "\"account_document\".\"invoice_status\" is null or \"account_document\".\"invoice_status\" in ('open', 'paid', 'overdue', 'void')" + }, + "account_document_currency_check": { + "name": "account_document_currency_check", + "value": "\"account_document\".\"currency\" is null or \"account_document\".\"currency\" ~ '^[A-Z]{3}$'" + } + }, + "isRLSEnabled": false + }, + "public.account_document_field": { + "name": "account_document_field", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "document_id": { + "name": "document_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "page": { + "name": "page", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "x": { + "name": "x", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "y": { + "name": "y", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "width": { + "name": "width", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "height": { + "name": "height", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "required": { + "name": "required", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "signer_role": { + "name": "signer_role", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'signer'" + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sort": { + "name": "sort", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": { + "account_document_field_document_id_index": { + "name": "account_document_field_document_id_index", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_document_field_document_id_foreign": { + "name": "account_document_field_document_id_foreign", + "tableFrom": "account_document_field", + "tableTo": "account_document", + "columnsFrom": [ + "document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "account_document_field_kind_check": { + "name": "account_document_field_kind_check", + "value": "\"account_document_field\".\"kind\" in ('signature', 'initials', 'name', 'role', 'date', 'text', 'checkbox')" + }, + "account_document_field_box_check": { + "name": "account_document_field_box_check", + "value": "\"account_document_field\".\"page\" >= 1 and \"account_document_field\".\"x\" between 0 and 1 and \"account_document_field\".\"y\" between 0 and 1 and \"account_document_field\".\"width\" between 0 and 1 and \"account_document_field\".\"height\" between 0 and 1" + } + }, + "isRLSEnabled": false + }, + "public.account_event": { + "name": "account_event", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "actor_kind": { + "name": "actor_kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "actor_user_id": { + "name": "actor_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subject_type": { + "name": "subject_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subject_id": { + "name": "subject_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "detail": { + "name": "detail", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "account_event_org_id_created_at_index": { + "name": "account_event_org_id_created_at_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_event_org_id_foreign": { + "name": "account_event_org_id_foreign", + "tableFrom": "account_event", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account_room_hint": { + "name": "account_room_hint", + "schema": "", + "columns": { + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dismissed_by": { + "name": "dismissed_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "dismissed_at": { + "name": "dismissed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "account_room_hint_org_id_foreign": { + "name": "account_room_hint_org_id_foreign", + "tableFrom": "account_room_hint", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "account_room_hint_dismissed_by_foreign": { + "name": "account_room_hint_dismissed_by_foreign", + "tableFrom": "account_room_hint", + "tableTo": "app_user", + "columnsFrom": [ + "dismissed_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "account_room_hint_org_id_label_pk": { + "name": "account_room_hint_org_id_label_pk", + "columns": [ + "org_id", + "label" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "account_room_hint_label_check": { + "name": "account_room_hint_label_check", + "value": "\"account_room_hint\".\"label\" in ('go_ahead', 'it_security', 'privacy_ai', 'contract_purchasing')" + } + }, + "isRLSEnabled": false + }, + "public.account_room_person": { + "name": "account_room_person", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "app_user_id": { + "name": "app_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "labels": { + "name": "labels", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "other": { + "name": "other", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_granted_at": { + "name": "access_granted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "invited_by": { + "name": "invited_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "org_invite_id": { + "name": "org_invite_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "labels_answered_at": { + "name": "labels_answered_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "account_room_person_org_id_app_user_id_index": { + "name": "account_room_person_org_id_app_user_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "app_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_room_person_org_id_foreign": { + "name": "account_room_person_org_id_foreign", + "tableFrom": "account_room_person", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "account_room_person_app_user_id_foreign": { + "name": "account_room_person_app_user_id_foreign", + "tableFrom": "account_room_person", + "tableTo": "app_user", + "columnsFrom": [ + "app_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "account_room_person_invited_by_foreign": { + "name": "account_room_person_invited_by_foreign", + "tableFrom": "account_room_person", + "tableTo": "app_user", + "columnsFrom": [ + "invited_by" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "account_room_person_org_invite_id_foreign": { + "name": "account_room_person_org_invite_id_foreign", + "tableFrom": "account_room_person", + "tableTo": "org_invite", + "columnsFrom": [ + "org_invite_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "account_room_person_org_id_email_unique": { + "name": "account_room_person_org_id_email_unique", + "nullsNotDistinct": false, + "columns": [ + "org_id", + "email" + ] + } + }, + "policies": {}, + "checkConstraints": { + "account_room_person_labels_check": { + "name": "account_room_person_labels_check", + "value": "\"account_room_person\".\"labels\" <@ array['go_ahead', 'rollout', 'it_security', 'privacy_ai', 'contract_purchasing', 'staff_stakeholders']::text[]" + }, + "account_room_person_other_check": { + "name": "account_room_person_other_check", + "value": "\"account_room_person\".\"other\" is null or char_length(\"account_room_person\".\"other\") <= 80" + } + }, + "isRLSEnabled": false + }, + "public.account_signature": { + "name": "account_signature", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "document_id": { + "name": "document_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "document_version": { + "name": "document_version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "signer_user_id": { + "name": "signer_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "typed_name": { + "name": "typed_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "typed_role": { + "name": "typed_role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organisation": { + "name": "organisation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "vat_number": { + "name": "vat_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dpa_authorised": { + "name": "dpa_authorised", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "field_values": { + "name": "field_values", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "image_key": { + "name": "image_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "image_sha256": { + "name": "image_sha256", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "initials_image_key": { + "name": "initials_image_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "signed_at": { + "name": "signed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "confirmation_text": { + "name": "confirmation_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "signed_pdf_key": { + "name": "signed_pdf_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "signed_pdf_sha256": { + "name": "signed_pdf_sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "outside_via": { + "name": "outside_via", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "accepted_on": { + "name": "accepted_on", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "evidence_key": { + "name": "evidence_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evidence_sha256": { + "name": "evidence_sha256", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evidence_name": { + "name": "evidence_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "evidence_type": { + "name": "evidence_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customer_reference": { + "name": "customer_reference", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "recorded_by": { + "name": "recorded_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "slot": { + "name": "slot", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'customer'" + } + }, + "indexes": { + "account_signature_org_id_index": { + "name": "account_signature_org_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_signature_document_id_foreign": { + "name": "account_signature_document_id_foreign", + "tableFrom": "account_signature", + "tableTo": "account_document", + "columnsFrom": [ + "document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "account_signature_document_slot_unique": { + "name": "account_signature_document_slot_unique", + "nullsNotDistinct": false, + "columns": [ + "document_id", + "slot" + ] + } + }, + "policies": {}, + "checkConstraints": { + "account_signature_slot_check": { + "name": "account_signature_slot_check", + "value": "\"account_signature\".\"slot\" in ('customer', 'second', 'dembrane')" + }, + "account_signature_method_check": { + "name": "account_signature_method_check", + "value": "\"account_signature\".\"method\" in ('drawn', 'typed', 'uploaded', 'outside', 'presigned')" + }, + "account_signature_outside_check": { + "name": "account_signature_outside_check", + "value": "(\"account_signature\".\"method\" = 'outside') = (\"account_signature\".\"outside_via\" is not null) and (\"account_signature\".\"outside_via\" is null or (\"account_signature\".\"outside_via\" in ('order_letter', 'email', 'paper', 'own_document') and \"account_signature\".\"accepted_on\" is not null and \"account_signature\".\"evidence_key\" is not null and \"account_signature\".\"evidence_sha256\" is not null))" + }, + "account_signature_image_check": { + "name": "account_signature_image_check", + "value": "\"account_signature\".\"method\" = 'outside' or (\"account_signature\".\"method\" = 'presigned' and \"account_signature\".\"slot\" = 'dembrane') or (\"account_signature\".\"signer_user_id\" is not null and \"account_signature\".\"image_key\" is not null and \"account_signature\".\"image_sha256\" is not null)" + } + }, + "isRLSEnabled": false + }, + "public.account_task": { + "name": "account_task", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "params": { + "name": "params", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'generic'" + }, + "document_id": { + "name": "document_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "unlock_on_document_id": { + "name": "unlock_on_document_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "due_on": { + "name": "due_on", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'open'" + }, + "opened_at": { + "name": "opened_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "response_text": { + "name": "response_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_file_key": { + "name": "response_file_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_file_name": { + "name": "response_file_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "submitted_at": { + "name": "submitted_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "submitted_by": { + "name": "submitted_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reviewed_at": { + "name": "reviewed_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reviewed_by": { + "name": "reviewed_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "review_note": { + "name": "review_note", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "reminder_interval_days": { + "name": "reminder_interval_days", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "next_reminder_at": { + "name": "next_reminder_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "reminders_sent": { + "name": "reminders_sent", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_by": { + "name": "created_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "account_task_org_id_index": { + "name": "account_task_org_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "account_task_org_id_status_index": { + "name": "account_task_org_id_status_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "account_task_next_reminder_at_index": { + "name": "account_task_next_reminder_at_index", + "columns": [ + { + "expression": "next_reminder_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_task_org_id_foreign": { + "name": "account_task_org_id_foreign", + "tableFrom": "account_task", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "account_task_document_id_foreign": { + "name": "account_task_document_id_foreign", + "tableFrom": "account_task", + "tableTo": "account_document", + "columnsFrom": [ + "document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "account_task_unlock_on_document_id_foreign": { + "name": "account_task_unlock_on_document_id_foreign", + "tableFrom": "account_task", + "tableTo": "account_document", + "columnsFrom": [ + "unlock_on_document_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "account_task_code_or_title_check": { + "name": "account_task_code_or_title_check", + "value": "\"account_task\".\"code\" is not null or \"account_task\".\"title\" is not null" + }, + "account_task_kind_check": { + "name": "account_task_kind_check", + "value": "\"account_task\".\"kind\" in ('sign', 'billing_details', 'upload', 'generic')" + }, + "account_task_status_check": { + "name": "account_task_status_check", + "value": "\"account_task\".\"status\" in ('locked', 'open', 'submitted', 'done', 'changes_requested', 'withdrawn')" + }, + "account_task_reminder_interval_check": { + "name": "account_task_reminder_interval_check", + "value": "\"account_task\".\"reminder_interval_days\" is null or \"account_task\".\"reminder_interval_days\" between 1 and 365" + } + }, + "isRLSEnabled": false + }, + "public.legal_text": { + "name": "legal_text", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "effective_on": { + "name": "effective_on", + "type": "date", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_url": { + "name": "source_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "legal_text_kind_created_at_index": { + "name": "legal_text_kind_created_at_index", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "legal_text_kind_sha256_unique": { + "name": "legal_text_kind_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "kind", + "sha256" + ] + } + }, + "policies": {}, + "checkConstraints": { + "legal_text_kind_check": { + "name": "legal_text_kind_check", + "value": "\"legal_text\".\"kind\" in ('terms', 'sla', 'dpa')" + } + }, + "isRLSEnabled": false + }, + "public.legal_text_source": { + "name": "legal_text_source", + "schema": "", + "columns": { + "kind": { + "name": "kind", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "checked_at": { + "name": "checked_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.offer_template": { + "name": "offer_template", + "schema": "", + "columns": { + "template": { + "name": "template", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "greeting": { + "name": "greeting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "intro": { + "name": "intro", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "closing": { + "name": "closing", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "columns": { + "name": "columns", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "valid_days": { + "name": "valid_days", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "offer_template_template_language_pk": { + "name": "offer_template_template_language_pk", + "columns": [ + "template", + "language" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "offer_template_template_check": { + "name": "offer_template_template_check", + "value": "\"offer_template\".\"template\" in ('subscription', 'event', 'custom')" + }, + "offer_template_language_check": { + "name": "offer_template_language_check", + "value": "\"offer_template\".\"language\" in ('en', 'nl')" + } + }, + "isRLSEnabled": false + }, + "public.auth_account": { + "name": "auth_account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "auth_account_user_id_index": { + "name": "auth_account_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "auth_account_user_id_auth_user_id_fk": { + "name": "auth_account_user_id_auth_user_id_fk", + "tableFrom": "auth_account", + "tableTo": "auth_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.auth_session": { + "name": "auth_session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "device_id": { + "name": "device_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "held": { + "name": "held", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "auth_session_user_id_index": { + "name": "auth_session_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "auth_session_user_id_auth_user_id_fk": { + "name": "auth_session_user_id_auth_user_id_fk", + "tableFrom": "auth_session", + "tableTo": "auth_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_session_token_unique": { + "name": "auth_session_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.auth_sign_in_overlap": { + "name": "auth_sign_in_overlap", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "session_id": { + "name": "session_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "device_id": { + "name": "device_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "other_sessions": { + "name": "other_sessions", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "other_devices": { + "name": "other_devices", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "other_last_seen_at": { + "name": "other_last_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "replaced_at": { + "name": "replaced_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "auth_sign_in_overlap_user_id_index": { + "name": "auth_sign_in_overlap_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "auth_sign_in_overlap_session_id_index": { + "name": "auth_sign_in_overlap_session_id_index", + "columns": [ + { + "expression": "session_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "auth_sign_in_overlap_user_id_auth_user_id_fk": { + "name": "auth_sign_in_overlap_user_id_auth_user_id_fk", + "tableFrom": "auth_sign_in_overlap", + "tableTo": "auth_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.auth_two_factor": { + "name": "auth_two_factor", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "backup_codes": { + "name": "backup_codes", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "verified": { + "name": "verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "failed_verification_count": { + "name": "failed_verification_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "locked_until": { + "name": "locked_until", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "auth_two_factor_user_id_index": { + "name": "auth_two_factor_user_id_index", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "auth_two_factor_user_id_auth_user_id_fk": { + "name": "auth_two_factor_user_id_auth_user_id_fk", + "tableFrom": "auth_two_factor", + "tableTo": "auth_user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.auth_user": { + "name": "auth_user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "two_factor_enabled": { + "name": "two_factor_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "auth_user_email_unique": { + "name": "auth_user_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.auth_verification": { + "name": "auth_verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "auth_verification_identifier_index": { + "name": "auth_verification_identifier_index", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ai_feature_rule": { + "name": "ai_feature_rule", + "schema": "", + "columns": { + "position": { + "name": "position", + "type": "integer", + "primaryKey": true, + "notNull": true + }, + "pattern": { + "name": "pattern", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature_group": { + "name": "feature_group", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "group_label": { + "name": "group_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "feature": { + "name": "feature", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ai_fx_rate": { + "name": "ai_fx_rate", + "schema": "", + "columns": { + "day": { + "name": "day", + "type": "date", + "primaryKey": true, + "notNull": true + }, + "usd_to_eur": { + "name": "usd_to_eur", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "fetched_at": { + "name": "fetched_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ai_price": { + "name": "ai_price", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "currency": { + "name": "currency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "input_per_m": { + "name": "input_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "cached_input_per_m": { + "name": "cached_input_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "audio_input_per_m": { + "name": "audio_input_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "output_per_m": { + "name": "output_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "long_context_threshold": { + "name": "long_context_threshold", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "long_input_per_m": { + "name": "long_input_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "long_cached_input_per_m": { + "name": "long_cached_input_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "long_output_per_m": { + "name": "long_output_per_m", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "per_audio_second": { + "name": "per_audio_second", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "per_search_query": { + "name": "per_search_query", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "effective_from": { + "name": "effective_from", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ai_price_provider_model_effective_from": { + "name": "ai_price_provider_model_effective_from", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "model", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "effective_from", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.ai_spend_daily": { + "name": "ai_spend_daily", + "schema": "", + "columns": { + "day": { + "name": "day", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "billing_account_id": { + "name": "billing_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payer": { + "name": "payer", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'unattributed'" + }, + "operation": { + "name": "operation", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "calls": { + "name": "calls", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "input_tokens": { + "name": "input_tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "output_tokens": { + "name": "output_tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "cost_micro_eur": { + "name": "cost_micro_eur", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ai_spend_daily_key": { + "name": "ai_spend_daily_key", + "columns": [ + { + "expression": "day", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"billing_account_id\", '00000000-0000-0000-0000-000000000000'::uuid)", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "payer", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "model", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "ai_spend_daily_billing_account_idx": { + "name": "ai_spend_daily_billing_account_idx", + "columns": [ + { + "expression": "billing_account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dbos_executor_heartbeat": { + "name": "dbos_executor_heartbeat", + "schema": "", + "columns": { + "executor_id": { + "name": "executor_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "last_seen": { + "name": "last_seen", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dbos_workflow_lost_worker": { + "name": "dbos_workflow_lost_worker", + "schema": "", + "columns": { + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "queue_name": { + "name": "queue_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lost": { + "name": "lost", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "set_aside_at": { + "name": "set_aside_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.free_usage": { + "name": "free_usage", + "schema": "", + "columns": { + "billing_account_id": { + "name": "billing_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "period_start": { + "name": "period_start", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "free_usage_billing_account_id_period_start_key_pk": { + "name": "free_usage_billing_account_id_period_start_key_pk", + "columns": [ + "billing_account_id", + "period_start", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.host_milestone": { + "name": "host_milestone", + "schema": "", + "columns": { + "directus_user_id": { + "name": "directus_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "milestone": { + "name": "milestone", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "reached_at": { + "name": "reached_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "host_milestone_directus_user_id_milestone_pk": { + "name": "host_milestone_directus_user_id_milestone_pk", + "columns": [ + "directus_user_id", + "milestone" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.model_call": { + "name": "model_call", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "service": { + "name": "service", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "operation": { + "name": "operation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model_group": { + "name": "model_group", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "finish_reason": { + "name": "finish_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "attempt": { + "name": "attempt", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "fallback": { + "name": "fallback", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "ms": { + "name": "ms", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "input_tokens": { + "name": "input_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "output_tokens": { + "name": "output_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "billing_account_id": { + "name": "billing_account_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "project_id": { + "name": "project_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "payer": { + "name": "payer", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'unattributed'" + }, + "counted": { + "name": "counted", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cached_input_tokens": { + "name": "cached_input_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "audio_input_tokens": { + "name": "audio_input_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "reasoning_tokens": { + "name": "reasoning_tokens", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "audio_seconds": { + "name": "audio_seconds", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "search_queries": { + "name": "search_queries", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "usage_estimated": { + "name": "usage_estimated", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "price_missing": { + "name": "price_missing", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cost_micro_eur": { + "name": "cost_micro_eur", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "price_id": { + "name": "price_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "model_call_started_at_idx": { + "name": "model_call_started_at_idx", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.platform_presence": { + "name": "platform_presence", + "schema": "", + "columns": { + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "seen_at": { + "name": "seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "platform_presence_scope_idx": { + "name": "platform_presence_scope_idx", + "columns": [ + { + "expression": "kind", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "scope", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seen_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "platform_presence_expires_idx": { + "name": "platform_presence_expires_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": { + "platform_presence_kind_key_pk": { + "name": "platform_presence_kind_key_pk", + "columns": [ + "kind", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.platform_rate_limit": { + "name": "platform_rate_limit", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "count": { + "name": "count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "reset_at": { + "name": "reset_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.popcorn_tensions_cache": { + "name": "popcorn_tensions_cache", + "schema": "", + "columns": { + "loop_id": { + "name": "loop_id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "cache": { + "name": "cache", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tier_limit": { + "name": "tier_limit", + "schema": "", + "columns": { + "tier": { + "name": "tier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_by": { + "name": "updated_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": { + "tier_limit_tier_key_pk": { + "name": "tier_limit_tier_key_pk", + "columns": [ + "tier", + "key" + ] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.staff_audit_event": { + "name": "staff_audit_event", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "staff_user_id": { + "name": "staff_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_type": { + "name": "target_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_id": { + "name": "target_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "detail": { + "name": "detail", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "staff_audit_event_staff_user_id_index": { + "name": "staff_audit_event_staff_user_id_index", + "columns": [ + { + "expression": "staff_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "staff_audit_event_target_index": { + "name": "staff_audit_event_target_index", + "columns": [ + { + "expression": "target_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "staff_audit_event_created_at_index": { + "name": "staff_audit_event_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.support_ticket": { + "name": "support_ticket", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "number": { + "name": "number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "support_ticket_number_seq", + "schema": "public", + "increment": "1", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "cache": "1", + "cycle": false + } + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'request'" + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'account'" + }, + "org_id": { + "name": "org_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "subject": { + "name": "subject", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'waiting_on_dembrane'" + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "suggested_category": { + "name": "suggested_category", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "opened_by": { + "name": "opened_by", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "requester_user_id": { + "name": "requester_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "assignee_user_id": { + "name": "assignee_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'accounts'" + }, + "context": { + "name": "context", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "first_response_at": { + "name": "first_response_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "resolved_at": { + "name": "resolved_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "forwarded_at": { + "name": "forwarded_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "requester_seen_at": { + "name": "requester_seen_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "support_ticket_org_id_index": { + "name": "support_ticket_org_id_index", + "columns": [ + { + "expression": "org_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_requester_user_id_index": { + "name": "support_ticket_requester_user_id_index", + "columns": [ + { + "expression": "requester_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_workspace_id_index": { + "name": "support_ticket_workspace_id_index", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_assignee_user_id_index": { + "name": "support_ticket_assignee_user_id_index", + "columns": [ + { + "expression": "assignee_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_status_updated_at_index": { + "name": "support_ticket_status_updated_at_index", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_updated_at_index": { + "name": "support_ticket_updated_at_index", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_created_at_index": { + "name": "support_ticket_created_at_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_resolved_at_index": { + "name": "support_ticket_resolved_at_index", + "columns": [ + { + "expression": "resolved_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_first_response_at_index": { + "name": "support_ticket_first_response_at_index", + "columns": [ + { + "expression": "first_response_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "support_ticket_unforwarded_index": { + "name": "support_ticket_unforwarded_index", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"support_ticket\".\"forwarded_at\" is null", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "support_ticket_org_id_foreign": { + "name": "support_ticket_org_id_foreign", + "tableFrom": "support_ticket", + "tableTo": "org", + "columnsFrom": [ + "org_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "support_ticket_workspace_id_foreign": { + "name": "support_ticket_workspace_id_foreign", + "tableFrom": "support_ticket", + "tableTo": "workspace", + "columnsFrom": [ + "workspace_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "support_ticket_number_unique": { + "name": "support_ticket_number_unique", + "nullsNotDistinct": false, + "columns": [ + "number" + ] + } + }, + "policies": {}, + "checkConstraints": { + "support_ticket_status_check": { + "name": "support_ticket_status_check", + "value": "\"support_ticket\".\"status\" in ('waiting_on_dembrane', 'waiting_on_customer', 'resolved', 'open', 'closed')" + }, + "support_ticket_kind_check": { + "name": "support_ticket_kind_check", + "value": "\"support_ticket\".\"kind\" in ('request', 'feedback', 'internal')" + }, + "support_ticket_scope_check": { + "name": "support_ticket_scope_check", + "value": "\"support_ticket\".\"scope\" in ('workspace', 'account', 'unplaced', 'internal')" + }, + "support_ticket_category_check": { + "name": "support_ticket_category_check", + "value": "\"support_ticket\".\"category\" is null or \"support_ticket\".\"category\" in ('problem', 'question', 'billing', 'account_access', 'idea')" + }, + "support_ticket_suggested_category_check": { + "name": "support_ticket_suggested_category_check", + "value": "\"support_ticket\".\"suggested_category\" is null or \"support_ticket\".\"suggested_category\" in ('problem', 'question', 'billing', 'account_access', 'idea')" + }, + "support_ticket_org_scope_check": { + "name": "support_ticket_org_scope_check", + "value": "\"support_ticket\".\"org_id\" is not null or \"support_ticket\".\"scope\" in ('unplaced', 'internal')" + }, + "support_ticket_source_check": { + "name": "support_ticket_source_check", + "value": "\"support_ticket\".\"source\" in ('app', 'feedback', 'assistant', 'mcp', 'staff', 'accounts')" + } + }, + "isRLSEnabled": false + }, + "public.support_ticket_message": { + "name": "support_ticket_message", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true + }, + "ticket_id": { + "name": "ticket_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "author_user_id": { + "name": "author_user_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "from_staff": { + "name": "from_staff", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "attachments": { + "name": "attachments", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "support_ticket_message_ticket_id_index": { + "name": "support_ticket_message_ticket_id_index", + "columns": [ + { + "expression": "ticket_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "support_ticket_message_ticket_id_foreign": { + "name": "support_ticket_message_ticket_id_foreign", + "tableFrom": "support_ticket_message", + "tableTo": "support_ticket", + "columnsFrom": [ + "ticket_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "support_ticket_message_visibility_check": { + "name": "support_ticket_message_visibility_check", + "value": "\"support_ticket_message\".\"visibility\" in ('public', 'internal_note')" + } + }, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": { + "public.conversation_record_transcript": { + "columns": { + "conversation_id": { + "name": "conversation_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "text": { + "name": "text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sentences": { + "name": "sentences", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "audio_seconds": { + "name": "audio_seconds", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "name": "conversation_record_transcript", + "schema": "public", + "isExisting": true, + "materialized": false + } + }, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/dembrane/platform/packages/db/migrations/meta/_journal.json b/dembrane/platform/packages/db/migrations/meta/_journal.json index f5bfd35a8..eddf5a2bc 100644 --- a/dembrane/platform/packages/db/migrations/meta/_journal.json +++ b/dembrane/platform/packages/db/migrations/meta/_journal.json @@ -456,6 +456,13 @@ "when": 1796215583115, "tag": "0064_expand_conversation_landscape", "breakpoints": true + }, + { + "idx": 65, + "version": "7", + "when": 1796221161682, + "tag": "0065_expand_conversation_consent", + "breakpoints": true } ] } \ No newline at end of file diff --git a/dembrane/platform/packages/db/src/schema/index.ts b/dembrane/platform/packages/db/src/schema/index.ts index bdc0cfaa1..a9ae492ae 100644 --- a/dembrane/platform/packages/db/src/schema/index.ts +++ b/dembrane/platform/packages/db/src/schema/index.ts @@ -1160,6 +1160,10 @@ export const conversation = pgTable( landscape_decided_at: timestamp({ withTimezone: true, mode: "string" }), landscape_moderation: jsonb(), landscape_entered_at: timestamp({ withTimezone: true, mode: "string" }), + // Recording consent provenance stamped by the server at conversation initiate. + consent_accepted_at: timestamp({ withTimezone: true, mode: "string" }), + consent_version: varchar({ length: 32 }), + consent_basis: varchar({ length: 32 }), }, (table): PgTableExtraConfigValue[] => [ foreignKey({